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 to configure logrotate
|
||||||
* Add support for Ubuntu Focal
|
* Add support for Ubuntu Focal
|
||||||
* Add support to configure SELinux
|
* 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:
|
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:
|
* Improve configuration templating capabilities:
|
||||||
* Add support for unix upstreams
|
* Add support for unix upstreams
|
||||||
* Add PID templating option
|
* Add PID templating option
|
||||||
|
@ -7,7 +7,7 @@ nginx_linux_families: ['Alpine', 'Debian', 'RedHat', 'Suse']
|
|||||||
# RedHat={Amazon,CentOS,OracleLinux,RHEL} Debian={Ubuntu,Debian}
|
# RedHat={Amazon,CentOS,OracleLinux,RHEL} Debian={Ubuntu,Debian}
|
||||||
nginx_plus_linux_families: ['Alpine', 'Debian', 'RedHat', 'Suse']
|
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
|
pcre_version: pcre-8.43
|
||||||
zlib_version: zlib-1.2.11
|
zlib_version: zlib-1.2.11
|
||||||
openssl_version: openssl-1.1.1c
|
openssl_version: openssl-1.1.1c
|
||||||
|
@ -1,8 +1,18 @@
|
|||||||
---
|
---
|
||||||
# Install NGINX.
|
# Enable NGINX options -- `nginx_install` and `nginx_configure`.
|
||||||
# Default is true.
|
# Default is true.
|
||||||
nginx_enable: 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.
|
# Start NGINX service.
|
||||||
# Default is true.
|
# Default is true.
|
||||||
nginx_start: true
|
nginx_start: true
|
||||||
@ -22,7 +32,7 @@ nginx_type: opensource
|
|||||||
# nginx_version: "-20*"
|
# nginx_version: "-20*"
|
||||||
|
|
||||||
# Specify whether you want to maintain your version of NGINX, upgrade to the latest version, or remove NGINX.
|
# 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 '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 '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.
|
# Using 'absent' will remove NGINX from your system.
|
||||||
@ -36,14 +46,11 @@ nginx_state: present
|
|||||||
nginx_install_from: nginx_repository
|
nginx_install_from: nginx_repository
|
||||||
|
|
||||||
# Specify source install options for NGINX Open Source.
|
# Specify source install options for NGINX Open Source.
|
||||||
# Options represent whether to install from source also
|
# Options represent whether to install from source also or to install from packages (default).
|
||||||
# or to install from packages (default). These only apply
|
# These only apply if 'nginx_install_from' is set to 'source'.
|
||||||
# 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.
|
||||||
# For the tools, true means we will install from a package
|
# 'nginx_install_source_build_tools' will install compiler and build tools from packages.
|
||||||
# and false means install from source.
|
# If false, you need to have these present.
|
||||||
# '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_build_tools: true
|
||||||
nginx_install_source_pcre: false
|
nginx_install_source_pcre: false
|
||||||
nginx_install_source_openssl: true
|
nginx_install_source_openssl: true
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
- 80
|
- 80
|
||||||
- 443
|
- 443
|
||||||
nginx_version: "{{ version }}"
|
nginx_version: "{{ version }}"
|
||||||
|
nginx_configure: false
|
||||||
nginx_logrotate_conf_enable: true
|
nginx_logrotate_conf_enable: true
|
||||||
nginx_logrotate_conf:
|
nginx_logrotate_conf:
|
||||||
paths:
|
paths:
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
- name: "(Install: Debian/Ubuntu/CentOS/RedHat/FreeBSD) Install NGINX"
|
- name: "(Install: Debian/Ubuntu/CentOS/RedHat/FreeBSD) Install NGINX"
|
||||||
block:
|
block:
|
||||||
|
|
||||||
|
- block:
|
||||||
- include_tasks: "{{ role_path }}/tasks/opensource/install-oss.yml"
|
- include_tasks: "{{ role_path }}/tasks/opensource/install-oss.yml"
|
||||||
when: nginx_type == "opensource"
|
when: nginx_type == "opensource"
|
||||||
tags: nginx_install_oss
|
tags: nginx_install_oss
|
||||||
@ -26,6 +27,18 @@
|
|||||||
when: nginx_type == "plus"
|
when: nginx_type == "plus"
|
||||||
tags: nginx_install_plus
|
tags: nginx_install_plus
|
||||||
|
|
||||||
|
- include_tasks: "{{ role_path }}/tasks/modules/install-modules.yml"
|
||||||
|
when: true in nginx_modules.values()
|
||||||
|
tags: nginx_install_modules
|
||||||
|
|
||||||
|
- include_tasks: "{{ role_path }}/tasks/plus/delete-license.yml"
|
||||||
|
when:
|
||||||
|
- nginx_type == "plus"
|
||||||
|
- nginx_delete_license
|
||||||
|
tags: nginx_delete_license
|
||||||
|
when: nginx_install | bool
|
||||||
|
|
||||||
|
- block:
|
||||||
- include_tasks: "{{ role_path }}/tasks/conf/cleanup-config.yml"
|
- include_tasks: "{{ role_path }}/tasks/conf/cleanup-config.yml"
|
||||||
when: nginx_cleanup_config | bool
|
when: nginx_cleanup_config | bool
|
||||||
tags: nginx_cleanup_config
|
tags: nginx_cleanup_config
|
||||||
@ -48,16 +61,7 @@
|
|||||||
- include_tasks: "{{ role_path }}/tasks/conf/setup-status.yml"
|
- include_tasks: "{{ role_path }}/tasks/conf/setup-status.yml"
|
||||||
when: nginx_status_enable | bool
|
when: nginx_status_enable | bool
|
||||||
tags: nginx_setup_status
|
tags: nginx_setup_status
|
||||||
|
when: nginx_configure | bool
|
||||||
- include_tasks: "{{ role_path }}/tasks/modules/install-modules.yml"
|
|
||||||
when: true in nginx_modules.values()
|
|
||||||
tags: nginx_install_modules
|
|
||||||
|
|
||||||
- include_tasks: "{{ role_path }}/tasks/plus/delete-license.yml"
|
|
||||||
when:
|
|
||||||
- nginx_type == "plus"
|
|
||||||
- nginx_delete_license
|
|
||||||
tags: nginx_delete_license
|
|
||||||
|
|
||||||
- name: "(Config: All OSs) Ensure NGINX is Running"
|
- name: "(Config: All OSs) Ensure NGINX is Running"
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
@ -69,7 +73,6 @@
|
|||||||
- include_tasks: "{{ role_path }}/tasks/conf/logrotate.yml"
|
- include_tasks: "{{ role_path }}/tasks/conf/logrotate.yml"
|
||||||
when: nginx_logrotate_conf_enable | bool
|
when: nginx_logrotate_conf_enable | bool
|
||||||
tags: nginx_logrotate_config
|
tags: nginx_logrotate_config
|
||||||
|
|
||||||
when: nginx_enable | bool
|
when: nginx_enable | bool
|
||||||
|
|
||||||
- include_tasks: "{{ role_path }}/tasks/amplify/install-amplify.yml"
|
- include_tasks: "{{ role_path }}/tasks/amplify/install-amplify.yml"
|
||||||
|
Loading…
Reference in New Issue
Block a user