Skip to content

Commit

Permalink
Merge pull request #38 from ANXS/farridav/update_module_on_change
Browse files Browse the repository at this point in the history
Update modules when they have changed
  • Loading branch information
otakup0pe committed Apr 5, 2015
2 parents 96aa4f3 + 54697ca commit a01e14c
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 41 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,17 @@ nginx_source_modules_included:
http_stub_status_module: "--with-http_stub_status_module"
http_ssl_module: "--with-http_ssl_module"
http_gzip_static_module: "--with-http_gzip_static_module"
upload_progress_module: "--add-module=/tmp/nginx_upload_progress"
headers_more_module: "--add-module=/tmp/nginx_headers_more"
http_auth_request_module: "--add-module=/tmp/nginx_auth_request"
http_echo_module: "--add-module=/tmp/nginx_echo"
upload_progress_module: "--add-module=/tmp/nginx-upload-progress-module-{{nginx_upload_progress_version}}"
headers_more_module: "--add-module=/tmp/headers-more-nginx-module-{{nginx_headers_more_version}}"
http_auth_request_module: "--add-module=/tmp/ngx_http_auth_request_module-{{nginx_auth_request_release}}"
http_echo_module: "--add-module=/tmp/echo-nginx-module-{{nginx_echo_version}}"
google_perftools_module: "--with-google_perftools_module"
ipv6_module: "--with-ipv6"
http_real_ip_module: "--with-http_realip_module"
http_spdy_module: "--with-http_spdy_module"
http_perl_module: "--with-http_perl_module"
naxsi_module: "--add-module=/tmp/nginx_naxsi"
ngx_pagespeed: "--add-module=/tmp/ngx_pagespeed"
naxsi_module: "--add-module=/tmp/naxsi-{{nginx_naxsi_version}}/naxsi_src"
ngx_pagespeed: "--add-module=/tmp/ngx_pagespeed-release-{{nginx_ngx_pagespeed_version}}-beta"
```
##### Sites
Expand Down
12 changes: 6 additions & 6 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ nginx_source_modules_included:
http_ssl_module: "--with-http_ssl_module"
openssl: "--with-openssl=/tmp/openssl-{{ openssl_version }}"
http_gzip_static_module: "--with-http_gzip_static_module"
upload_progress_module: "--add-module=/tmp/nginx_upload_progress"
headers_more_module: "--add-module=/tmp/nginx_headers_more"
http_auth_request_module: "--add-module=/tmp/nginx_auth_request"
http_echo_module: "--add-module=/tmp/nginx_echo"
upload_progress_module: "--add-module=/tmp/nginx-upload-progress-module-{{nginx_upload_progress_version}}"
headers_more_module: "--add-module=/tmp/headers-more-nginx-module-{{nginx_headers_more_version}}"
http_auth_request_module: "--add-module=/tmp/ngx_http_auth_request_module-{{nginx_auth_request_release}}"
http_echo_module: "--add-module=/tmp/echo-nginx-module-{{nginx_echo_version}}"
google_perftools_module: "--with-google_perftools_module"
ipv6_module: "--with-ipv6"
http_real_ip_module: "--with-http_realip_module"
http_spdy_module: "--with-http_spdy_module"
http_perl_module: "--with-http_perl_module"
naxsi_module: "--add-module=/tmp/nginx_naxsi"
ngx_pagespeed: "--add-module=/tmp/ngx_pagespeed"
naxsi_module: "--add-module=/tmp/naxsi-{{nginx_naxsi_version}}/naxsi_src"
ngx_pagespeed: "--add-module=/tmp/ngx_pagespeed-release-{{nginx_ngx_pagespeed_version}}-beta"

nginx_source_modules_excluded:
- mail_pop3_module
Expand Down
6 changes: 2 additions & 4 deletions tasks/modules/headers_more_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@
dest: "/tmp/nginx-headers-more-module-{{nginx_headers_more_version}}.tar.gz"

- name: Nginx | Modules | Unpack the headers_more_module source
command: tar -xvzf /tmp/nginx-headers-more-module-{{nginx_headers_more_version}}.tar.gz chdir=/tmp creates=/tmp/headers-more-nginx-module-{{nginx_headers_more_version}}

- name: Nginx | Modules | Copy the headers_more_module source folder
command: sudo cp -R /tmp/headers-more-nginx-module-{{nginx_headers_more_version}} /tmp/nginx_headers_more creates=/tmp/nginx_headers_more
command: tar -xvzf /tmp/nginx-headers-more-module-{{nginx_headers_more_version}}.tar.gz
chdir=/tmp creates=/tmp/headers-more-nginx-module-{{nginx_headers_more_version}}
4 changes: 0 additions & 4 deletions tasks/modules/http_auth_request_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@

- name: Nginx | Modules | Unpack the http_auth_request_module source
command: tar -xvzf /tmp/nginx-auth-request-module.tar.gz chdir=/tmp creates=/tmp/ngx_http_auth_request_module-{{nginx_auth_request_release}}

- name: Nginx | Modules | Copy the http_auth_request_module source folder
command: sudo cp -R /tmp/ngx_http_auth_request_module-{{nginx_auth_request_release}} /tmp/nginx_auth_request creates=/tmp/nginx_auth_request

3 changes: 0 additions & 3 deletions tasks/modules/http_echo_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@

- name: Nginx | Modules | Unpack the http_echo_module source
command: tar -xvzf /tmp/nginx-echo-module.tar.gz chdir=/tmp creates=/tmp/echo-nginx-module-{{nginx_echo_version}}

- name: Nginx | Modules | Copy the http_echo_module source folder
command: sudo cp -R /tmp/echo-nginx-module-{{nginx_echo_version}} /tmp/nginx_echo creates=/tmp/nginx_echo
5 changes: 1 addition & 4 deletions tasks/modules/naxsi_module.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# file: roles/nginx/tasks/modules/naxsi_module.yml
# configure flag: --add-module=/tmp/nginx_naxsi
# configure flag: --add-module=/tmp/naxsi-{{nginx_naxsi_version}}/naxsi_src

- name: Nginx | Modules | Download the naxsi_module source
get_url:
Expand All @@ -9,9 +9,6 @@
- name: Nginx | Modules | Unpack the naxsi_module source
command: tar -xvzf /tmp/nginx-naxsi-module.tar.gz chdir=/tmp creates=/tmp/naxsi-{{nginx_naxsi_version}}

- name: Nginx | Modules | Copy the naxsi_module source folder
command: sudo cp -R /tmp/naxsi-{{nginx_naxsi_version}}/naxsi_src /tmp/nginx_naxsi creates=/tmp/nginx_naxsi

- name: Nginx | Modules | Make sure the naxsi_module configuration is up to date
copy:
src: ../../files/naxsi_core.rules
Expand Down
17 changes: 6 additions & 11 deletions tasks/modules/ngx_pagespeed.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# file: nginx/tasks/modules/ngx_pagespeed.yml
# configure flag: --add-module=/tmp/ngx_pagespeed
# configure flag: --add-module=/tmp/ngx_pagespeed-release-{{nginx_ngx_pagespeed_version}}-beta

- name: Nginx | Modules | Make sure the dependences are installed
apt:
Expand All @@ -13,25 +13,20 @@
get_url:
url: "https://github.com/pagespeed/ngx_pagespeed/archive/release-{{nginx_ngx_pagespeed_version}}-beta.tar.gz"
dest: "/tmp/ngx_pagespeed_module.tar.gz"
register: ngx_pagespeed_download

- name: Nginx | Modules | Unpack the ngx_pagespeed source
command: tar -xvzf /tmp/ngx_pagespeed_module.tar.gz
args:
chdir: /tmp
creates: "ngx_pagespeed-release-{{nginx_ngx_pagespeed_version}}-beta"

- name: Nginx | Modules | Copy the ngx_pagespeed source folder
command: sudo cp -R /tmp/ngx_pagespeed-release-{{nginx_ngx_pagespeed_version}}-beta /tmp/ngx_pagespeed
when: ngx_pagespeed_download.changed
creates: "/tmp/ngx_pagespeed-release-{{nginx_ngx_pagespeed_version}}-beta"

- name: Nginx | Modules | Download the psol source
get_url:
url: "https://dl.google.com/dl/page-speed/psol/{{nginx_ngx_pagespeed_version}}.tar.gz"
dest: "/tmp/ngx_pagespeed/psol.tar.gz"
dest: "/tmp/ngx_pagespeed-release-{{nginx_ngx_pagespeed_version}}-beta/psol.tar.gz"

- name: Nginx | Modules | Unpack the psol source
command: "tar -xvzf /tmp/ngx_pagespeed/psol.tar.gz"
command: "tar -xvzf /tmp/ngx_pagespeed-release-{{nginx_ngx_pagespeed_version}}-beta/psol.tar.gz"
args:
chdir: "/tmp/ngx_pagespeed"
creates: "/tmp/ngx_pagespeed/psol"
chdir: "/tmp/ngx_pagespeed-release-{{nginx_ngx_pagespeed_version}}-beta"
creates: "/tmp/ngx_pagespeed-release-{{nginx_ngx_pagespeed_version}}-beta/psol"
3 changes: 0 additions & 3 deletions tasks/modules/upload_progress_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
- name: Nginx | Modules | Unpack the upload_progress_module source
command: tar -xvzf /tmp/nginx-upload-progress-module-{{nginx_upload_progress_version}}.tar.gz chdir=/tmp creates=/tmp/nginx-upload-progress-module-{{nginx_upload_progress_version}}

- name: Nginx | Modules | Copy the upload_progress_module source folder
command: sudo cp -R /tmp/nginx-upload-progress-module-{{nginx_upload_progress_version}} /tmp/nginx_upload_progress creates=/tmp/nginx_upload_progress

- name: Nginx | Modules | Make sure the upload_progress_module configuration is updated
template:
src: ../../templates/modules/upload_progress.j2
Expand Down

0 comments on commit a01e14c

Please sign in to comment.