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: 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. * 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) ## 0.20.0 (June 9, 2021)

View File

@ -34,6 +34,12 @@ nginx_type: opensource
# Default is present. # Default is present.
nginx_state: 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. # Specify repository origin for NGINX Open Source.
# Options are 'nginx_repository', 'source' or 'os_repository'. # Options are 'nginx_repository', 'source' or 'os_repository'.
# Only works if 'nginx_type' is set to 'opensource'. # Only works if 'nginx_type' is set to 'opensource'.

View File

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

View File

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

View File

@ -7,7 +7,9 @@
enabled: true enabled: true
gpgcheck: true gpgcheck: true
mode: 0644 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 - name: (CentOS/RHEL 8) Configure NGINX repository
blockinfile: blockinfile:
@ -21,7 +23,9 @@
name = NGINX Repository name = NGINX Repository
module_hotfixes = true module_hotfixes = true
mode: 0644 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 - name: (CentOS/RHEL) Install NGINX
yum: yum:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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