Add separate variables for installing and configuring NGINX (#284)
This commit is contained in:
parent
968bf3e10c
commit
e9b6c59733
@ -12,10 +12,11 @@ FEATURES:
|
||||
* Add support to configure logrotate
|
||||
* Add support for Ubuntu Focal
|
||||
* Add support to configure SELinux
|
||||
* Two new variables have been introduced -- `nginx_install` and `nginx_configure` -- to let you choose whether you want to install NGINX, configure NGINX, or both
|
||||
|
||||
ENHANCEMENTS:
|
||||
|
||||
* Use `include_tasks` instead of `import_tasks` when possible to speed up the role's execution time
|
||||
* The role now uses `include_tasks` instead of `import_tasks` when possible to speed up the role's execution time
|
||||
* Improve configuration templating capabilities:
|
||||
* Add support for unix upstreams
|
||||
* Add PID templating option
|
||||
|
@ -7,7 +7,7 @@ nginx_linux_families: ['Alpine', 'Debian', 'RedHat', 'Suse']
|
||||
# RedHat={Amazon,CentOS,OracleLinux,RHEL} Debian={Ubuntu,Debian}
|
||||
nginx_plus_linux_families: ['Alpine', 'Debian', 'RedHat', 'Suse']
|
||||
|
||||
# Default locations and versions for install from source
|
||||
# Default locations and versions when 'nginx_install_from; is set to 'source'
|
||||
pcre_version: pcre-8.43
|
||||
zlib_version: zlib-1.2.11
|
||||
openssl_version: openssl-1.1.1c
|
||||
|
@ -1,8 +1,18 @@
|
||||
---
|
||||
# Install NGINX.
|
||||
# Enable NGINX options -- `nginx_install` and `nginx_configure`.
|
||||
# Default is true.
|
||||
nginx_enable: true
|
||||
|
||||
# Install NGINX and NGINX modules.
|
||||
# Variables for these options can be found below.
|
||||
# Default is true.
|
||||
nginx_install: true
|
||||
|
||||
# Enable NGINX configuration options.
|
||||
# Variables for these options can be found in `./template.yml` and `./upload.yml`.
|
||||
# Default is true.
|
||||
nginx_configure: true
|
||||
|
||||
# Start NGINX service.
|
||||
# Default is true.
|
||||
nginx_start: true
|
||||
@ -22,7 +32,7 @@ nginx_type: opensource
|
||||
# nginx_version: "-20*"
|
||||
|
||||
# Specify whether you want to maintain your version of NGINX, upgrade to the latest version, or remove NGINX.
|
||||
# Can be used with `nginx_version` to achieve fine tune control on which version of NGINX is installed/used on each playbook execution.
|
||||
# Can be used with `nginx_version` to fine tune control on which version of NGINX is installed/used on each playbook execution.
|
||||
# Using 'present' will install the latest version (or 'nginx_version') of NGINX on a fresh install.
|
||||
# Using 'latest' will upgrade NGINX to the latest version (that matches your 'nginx_version') of NGINX on every playbook execution.
|
||||
# Using 'absent' will remove NGINX from your system.
|
||||
@ -36,14 +46,11 @@ nginx_state: present
|
||||
nginx_install_from: nginx_repository
|
||||
|
||||
# Specify source install options for NGINX Open Source.
|
||||
# Options represent whether to install from source also
|
||||
# or to install from packages (default). These only apply
|
||||
# if 'nginx_install_from' is set to 'source'
|
||||
# For the tools, true means we will install from a package
|
||||
# and false means install from source.
|
||||
# 'nginx_install_source_build_tools' will install compiler
|
||||
# and build tools from packages. If false, you need to have
|
||||
# these present.
|
||||
# Options represent whether to install from source also or to install from packages (default).
|
||||
# These only apply if 'nginx_install_from' is set to 'source'.
|
||||
# For the tools, true means we will install from a package and false means install from source.
|
||||
# 'nginx_install_source_build_tools' will install compiler and build tools from packages.
|
||||
# If false, you need to have these present.
|
||||
nginx_install_source_build_tools: true
|
||||
nginx_install_source_pcre: false
|
||||
nginx_install_source_openssl: true
|
||||
|
@ -30,6 +30,7 @@
|
||||
- 80
|
||||
- 443
|
||||
nginx_version: "{{ version }}"
|
||||
nginx_configure: false
|
||||
nginx_logrotate_conf_enable: true
|
||||
nginx_logrotate_conf:
|
||||
paths:
|
||||
|
@ -18,46 +18,50 @@
|
||||
- name: "(Install: Debian/Ubuntu/CentOS/RedHat/FreeBSD) Install NGINX"
|
||||
block:
|
||||
|
||||
- include_tasks: "{{ role_path }}/tasks/opensource/install-oss.yml"
|
||||
when: nginx_type == "opensource"
|
||||
tags: nginx_install_oss
|
||||
- block:
|
||||
- include_tasks: "{{ role_path }}/tasks/opensource/install-oss.yml"
|
||||
when: nginx_type == "opensource"
|
||||
tags: nginx_install_oss
|
||||
|
||||
- include_tasks: "{{ role_path }}/tasks/plus/install-plus.yml"
|
||||
when: nginx_type == "plus"
|
||||
tags: nginx_install_plus
|
||||
- include_tasks: "{{ role_path }}/tasks/plus/install-plus.yml"
|
||||
when: nginx_type == "plus"
|
||||
tags: nginx_install_plus
|
||||
|
||||
- include_tasks: "{{ role_path }}/tasks/conf/cleanup-config.yml"
|
||||
when: nginx_cleanup_config | bool
|
||||
tags: nginx_cleanup_config
|
||||
- include_tasks: "{{ role_path }}/tasks/modules/install-modules.yml"
|
||||
when: true in nginx_modules.values()
|
||||
tags: nginx_install_modules
|
||||
|
||||
- include_tasks: "{{ role_path }}/tasks/conf/upload-config.yml"
|
||||
when: nginx_main_upload_enable
|
||||
or nginx_http_upload_enable
|
||||
or nginx_stream_upload_enable
|
||||
or nginx_html_upload_enable
|
||||
or nginx_ssl_upload_enable
|
||||
tags: nginx_upload_config
|
||||
- include_tasks: "{{ role_path }}/tasks/plus/delete-license.yml"
|
||||
when:
|
||||
- nginx_type == "plus"
|
||||
- nginx_delete_license
|
||||
tags: nginx_delete_license
|
||||
when: nginx_install | bool
|
||||
|
||||
- include_tasks: "{{ role_path }}/tasks/conf/template-config.yml"
|
||||
when: nginx_main_template_enable
|
||||
or nginx_http_template_enable
|
||||
or nginx_stream_template_enable
|
||||
or nginx_rest_api_enable
|
||||
tags: nginx_template_config
|
||||
- block:
|
||||
- include_tasks: "{{ role_path }}/tasks/conf/cleanup-config.yml"
|
||||
when: nginx_cleanup_config | bool
|
||||
tags: nginx_cleanup_config
|
||||
|
||||
- include_tasks: "{{ role_path }}/tasks/conf/setup-status.yml"
|
||||
when: nginx_status_enable | bool
|
||||
tags: nginx_setup_status
|
||||
- include_tasks: "{{ role_path }}/tasks/conf/upload-config.yml"
|
||||
when: nginx_main_upload_enable
|
||||
or nginx_http_upload_enable
|
||||
or nginx_stream_upload_enable
|
||||
or nginx_html_upload_enable
|
||||
or nginx_ssl_upload_enable
|
||||
tags: nginx_upload_config
|
||||
|
||||
- include_tasks: "{{ role_path }}/tasks/modules/install-modules.yml"
|
||||
when: true in nginx_modules.values()
|
||||
tags: nginx_install_modules
|
||||
- include_tasks: "{{ role_path }}/tasks/conf/template-config.yml"
|
||||
when: nginx_main_template_enable
|
||||
or nginx_http_template_enable
|
||||
or nginx_stream_template_enable
|
||||
or nginx_rest_api_enable
|
||||
tags: nginx_template_config
|
||||
|
||||
- include_tasks: "{{ role_path }}/tasks/plus/delete-license.yml"
|
||||
when:
|
||||
- nginx_type == "plus"
|
||||
- nginx_delete_license
|
||||
tags: nginx_delete_license
|
||||
- include_tasks: "{{ role_path }}/tasks/conf/setup-status.yml"
|
||||
when: nginx_status_enable | bool
|
||||
tags: nginx_setup_status
|
||||
when: nginx_configure | bool
|
||||
|
||||
- name: "(Config: All OSs) Ensure NGINX is Running"
|
||||
meta: flush_handlers
|
||||
@ -69,7 +73,6 @@
|
||||
- include_tasks: "{{ role_path }}/tasks/conf/logrotate.yml"
|
||||
when: nginx_logrotate_conf_enable | bool
|
||||
tags: nginx_logrotate_config
|
||||
|
||||
when: nginx_enable | bool
|
||||
|
||||
- include_tasks: "{{ role_path }}/tasks/amplify/install-amplify.yml"
|
||||
|
Loading…
Reference in New Issue
Block a user