summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2020-01-18 02:46:15 -0500
committerThedro Neely <thedroneely@gmail.com>2020-01-18 02:46:15 -0500
commitbacbe7d59fa8201c58bf330325811284377f314d (patch)
tree8c105643db3ed459109a9f5bbd4206ca6cb100ad
parent8a75c065b4a432511c052e87b81f2b6939e39332 (diff)
downloadplaybooks-bacbe7d59fa8201c58bf330325811284377f314d.tar.gz
playbooks-bacbe7d59fa8201c58bf330325811284377f314d.tar.bz2
playbooks-bacbe7d59fa8201c58bf330325811284377f314d.zip
roles/nginx/main: Build and install
-rw-r--r--roles/nginx/main.yml88
1 files changed, 85 insertions, 3 deletions
diff --git a/roles/nginx/main.yml b/roles/nginx/main.yml
index 2c9f3cc..234c437 100644
--- a/roles/nginx/main.yml
+++ b/roles/nginx/main.yml
@@ -45,6 +45,7 @@
- gd-dev
- geoip-dev
- perl-dev
+ - tar
- name: Installing the required brotli dependencies
apk:
@@ -103,10 +104,91 @@
- name: Verifying application
shell: |
- gpg --batch --verify nginx-"{{ nginx_version }}"-tar.gz nginx-"{{ nginx_version }}".tar.gz.asc
- touch .nginx-"{{ nginx_version }}"-verified
+ gpg --batch --verify nginx-{{ nginx_version }}-tar.gz nginx-{{ nginx_version }}.tar.gz.asc
+ touch .nginx-{{ nginx_version }}-verified
args:
chdir: /opt/nginx
- creates: .nginx-"{{ nginx_version }}"-verified
+ creates: .nginx-{{ nginx_version }}-verified
+ - name: Extracting application source
+ unarchive:
+ src: /opt/nginx/nginx-{{ nginx_version}}.tar.gz
+ dest: /opt/nginx
+ remote_src: yes
+ - name: Building application
+ shell: >
+ export CONFIG="
+ --prefix=/etc/nginx
+ --sbin-path=/usr/sbin/nginx
+ --modules-path=/usr/lib/nginx/modules
+ --conf-path=/etc/nginx/nginx.conf
+ --error-log-path=/var/log/nginx/error.log
+ --http-log-path=/var/log/nginx/access.log
+ --pid-path=/var/run/nginx.pid
+ --lock-path=/var/run/nginx.lock
+ --http-client-body-temp-path=/var/cache/nginx/client_temp
+ --http-proxy-temp-path=/var/cache/nginx/proxy_temp
+ --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
+ --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
+ --http-scgi-temp-path=/var/cache/nginx/scgi_temp
+ --user=nginx
+ --group=nginx
+ --with-http_ssl_module
+ --with-http_realip_module
+ --with-http_addition_module
+ --with-http_sub_module
+ --with-http_dav_module
+ --with-http_flv_module
+ --with-http_mp4_module
+ --with-http_gunzip_module
+ --with-http_gzip_static_module
+ --with-http_random_index_module
+ --with-http_secure_link_module
+ --with-http_stub_status_module
+ --with-http_auth_request_module
+ --with-http_xslt_module=dynamic
+ --with-http_image_filter_module=dynamic
+ --with-http_geoip_module=dynamic
+ --with-http_perl_module=dynamic
+ --with-threads
+ --with-stream
+ --with-stream_ssl_module
+ --with-stream_ssl_preread_module
+ --with-stream_realip_module
+ --with-stream_geoip_module=dynamic
+ --with-http_slice_module
+ --with-mail
+ --with-mail_ssl_module
+ --with-compat
+ --with-file-aio
+ --with-http_v2_module
+ --with-http_v3_module
+ --with-openssl=/opt/nginx/quiche/deps/boringssl
+ --with-quiche=/opt/nginx/quiche
+ --with-ipv6
+ --add-module=/opt/nginx/brotli
+ --add-module=/opt/nginx/nginx-headers
+ --with-cc-opt=-Wno-error"
+ && patch -p01 < ../quiche/extras/nginx/nginx-1.16.patch
+ && ./configure $CONFIG
+ && make -j$(getconf _NPROCESSORS_ONLN)
+ args:
+ chdir: /opt/nginx/nginx-{{ nginx_version }}
+ creates: objs/nginx
+ register: output
+ - debug: var=output
+
+ - name: Installing Application
+ shell: >
+ make install
+ && mkdir -p /etc/nginx/default.d
+ && mkdir -p /etc/nginx/conf.d
+ && mkdir -p /etc/nginx/sites-available
+ && mkdir -p /etc/nginx/sites-enabled
+ && strip /usr/sbin/nginx*
+ && strip /usr/lib/nginx/modules/*.so
+ args:
+ chdir: /opt/nginx/nginx-{{ nginx_version }}
+ register: output
+ - debug: var=output