Add 'nginx_manage_repo' feature flag and defaults (#420)

Co-authored-by: Jurgen Verhasselt <hello@sjugge.be>
Co-authored-by: Jurgen Verhasselt <sjugge@inuits.eu>
This commit is contained in:
Jurgen Verhasselt 2021-06-14 16:57:18 +02:00 committed by GitHub
parent f1272ef80e
commit 3a63b9acf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 21 additions and 2 deletions

View File

@ -4,6 +4,7 @@
FEATURES:
* Add a `nginx_manage_repo` feature flag which allows disabling NGINX repo management by this role.
* Add a `nginx_install_epel_release` feature flag which allows epel-release to not be installed by this role if so desired.
## 0.20.0 (June 9, 2021)

View File

@ -34,6 +34,12 @@ nginx_type: opensource
# Default is present.
nginx_state: present
# Specify whether or not you want to manage the NGINX repositories.
# Using 'true' will manage NGINX repositories.
# Using 'false' will not manage the NGINX repositories, allowing them to be managed through other means.
# Default is true
nginx_manage_repo: true
# Specify repository origin for NGINX Open Source.
# Options are 'nginx_repository', 'source' or 'os_repository'.
# Only works if 'nginx_type' is set to 'opensource'.

View File

@ -4,6 +4,7 @@
path: /etc/apk/repositories
insertafter: EOF
line: "{{ nginx_repository | default(nginx_default_repository_alpine) }}"
when: nginx_manage_repo | bool
- name: (Alpine Linux) Install NGINX
apk:

View File

@ -6,6 +6,7 @@
update_cache: true
mode: 0644
loop: "{{ nginx_repository | default(nginx_default_repository_debian) }}"
when: nginx_manage_repo | bool
- name: (Debian/Ubuntu) Install NGINX
apt:

View File

@ -7,7 +7,9 @@
enabled: true
gpgcheck: true
mode: 0644
when: ansible_facts['distribution_major_version'] is version('8', '<')
when:
- ansible_facts['distribution_major_version'] is version('8', '<')
- nginx_manage_repo | bool
- name: (CentOS/RHEL 8) Configure NGINX repository
blockinfile:
@ -21,7 +23,9 @@
name = NGINX Repository
module_hotfixes = true
mode: 0644
when: ansible_facts['distribution_major_version'] is version('8', '==')
when:
- ansible_facts['distribution_major_version'] is version('8', '==')
- nginx_manage_repo | bool
- name: (CentOS/RHEL) Install NGINX
yum:

View File

@ -3,6 +3,7 @@
zypper_repository:
name: "nginx-{{ nginx_branch }}"
repo: "{{ nginx_repository | default(nginx_default_repository_suse) }}"
when: nginx_manage_repo | bool
- name: (SLES) Install NGINX
zypper:

View File

@ -5,6 +5,7 @@
insertafter: EOF
line: "{{ nginx_repository | default(nginx_plus_default_repository_alpine) }}"
state: "{{ nginx_license_status | default ('present') }}"
when: nginx_manage_repo | bool
- name: (Alpine Linux) Install NGINX Plus
apk:

View File

@ -18,6 +18,7 @@
update_cache: false
state: "{{ nginx_license_status | default ('present') }}"
mode: 0644
when: nginx_manage_repo | bool
- name: (Debian/Ubuntu) Install NGINX Plus
apt:

View File

@ -20,6 +20,7 @@
}
state: "{{ nginx_license_status | default ('present') }}"
mode: 0644
when: nginx_manage_repo | bool
- name: (FreeBSD) Install NGINX Plus
pkgng:

View File

@ -11,6 +11,7 @@
gpgcheck: true
state: "{{ nginx_license_status | default ('present') }}"
mode: 0644
when: nginx_manage_repo | bool
- name: (Amazon Linux/CentOS/Oracle Linux/RHEL) Install NGINX Plus
yum:

View File

@ -11,6 +11,7 @@
name: nginx-plus
repo: "{{ nginx_repository | default(nginx_plus_default_repository_suse) }}"
state: "{{ nginx_license_status | default ('present') }}"
when: nginx_manage_repo | bool
- name: (SLES) Install NGINX Plus
zypper: