Update the URL used to fetch the latest NGINX source version (#411)

This commit is contained in:
Alessandro Fael Garcia 2021-05-26 17:56:36 +02:00 committed by GitHub
parent 7d2ad8770c
commit d3cfac4ac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 20 deletions

View File

@ -7,6 +7,10 @@ BREAKING CHANGES:
* The NGINX Plus repository has been updated. This might cause some issues when running the role on an instance that already has NGINX Plus installed. **Starting with NGINX Plus R25, you will need to install NGINX Plus using release `0.20.0`. If you are trying to install R23, please use release `0.19.2`. NGINX Plus R24 should work with both release `0.19.2` and `0.20.0`.** * The NGINX Plus repository has been updated. This might cause some issues when running the role on an instance that already has NGINX Plus installed. **Starting with NGINX Plus R25, you will need to install NGINX Plus using release `0.20.0`. If you are trying to install R23, please use release `0.19.2`. NGINX Plus R24 should work with both release `0.19.2` and `0.20.0`.**
* The NGINX Plus modsecurity module is no longer supported by this role. Until NGINX Plus R25 is released, you might keep using release `0.19.2` if you wish to install modsecurity. * The NGINX Plus modsecurity module is no longer supported by this role. Until NGINX Plus R25 is released, you might keep using release `0.19.2` if you wish to install modsecurity.
BUG FIXES:
Change the url used to grep the latest NGINX version when installing from source. This should avoid the source install failing whenever the `stable` release is higher than the latest `mainline`.
## 0.19.2 (April 28, 2021) ## 0.19.2 (April 28, 2021)
FEATURES: FEATURES:

View File

@ -283,31 +283,16 @@
block: block:
- name: Fetch NGINX version - name: Fetch NGINX version
uri: uri:
url: https://trac.nginx.org/nginx/browser url: https://version.nginx.com/nginx/{{ nginx_branch }}
return_content: yes return_content: yes
validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '==')) validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '=='))
| ternary('no', 'yes') }}" | ternary('no', 'yes') }}"
check_mode: no check_mode: no
register: nginx_versions register: nginx_versions
- name: Set NGINX mainline version - name: Set NGINX version
set_fact: set_fact:
nginx_version: "{{ nginx_versions.content | regex_search('release[^<]*') | regex_replace('release', 'nginx') }}" nginx_version: "{{ 'nginx-' + (nginx_versions.content | regex_search('([0-9]+\\.){2}[0-9]+')) }}"
when: nginx_branch == "mainline"
- name: Set NGINX stable version 1/2
set_fact:
nginx_version: "{{ nginx_versions.content | regex_search('stable[^<]*') | regex_replace('stable', 'release') }}"
when: nginx_branch == "stable"
- name: Set NGINX stable version 2/2
set_fact:
nginx_version: "{{ nginx_versions.content | regex_search(nginx_version + '[^<]*') | regex_replace('release', 'nginx') }}"
when: nginx_branch == "stable"
- name: Set NGINX download filename
set_fact:
nginx_download_name: "{{ nginx_version }}"
- name: Check for NGINX install - name: Check for NGINX install
stat: stat:
@ -323,8 +308,8 @@
block: block:
- name: Download NGINX - name: Download NGINX
get_url: get_url:
url: "https://nginx.org/download/{{ nginx_download_name }}.tar.gz" url: "https://nginx.org/download/{{ nginx_version }}.tar.gz"
dest: "/tmp/{{ nginx_download_name }}.tar.gz" dest: "/tmp/{{ nginx_version }}.tar.gz"
mode: 0600 mode: 0600
validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '==')) validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '=='))
| ternary('no', 'yes') }}" | ternary('no', 'yes') }}"