Skip to content

Commit d3cfac4

Browse files
authored
Update the URL used to fetch the latest NGINX source version (#411)
1 parent 7d2ad87 commit d3cfac4

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ BREAKING CHANGES:
77
* 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`.**
88
* 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.
99

10+
BUG FIXES:
11+
12+
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`.
13+
1014
## 0.19.2 (April 28, 2021)
1115

1216
FEATURES:

tasks/opensource/install-source.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -283,31 +283,16 @@
283283
block:
284284
- name: Fetch NGINX version
285285
uri:
286-
url: https://trac.nginx.org/nginx/browser
286+
url: https://version.nginx.com/nginx/{{ nginx_branch }}
287287
return_content: yes
288288
validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '=='))
289289
| ternary('no', 'yes') }}"
290290
check_mode: no
291291
register: nginx_versions
292292

293-
- name: Set NGINX mainline version
293+
- name: Set NGINX version
294294
set_fact:
295-
nginx_version: "{{ nginx_versions.content | regex_search('release[^<]*') | regex_replace('release', 'nginx') }}"
296-
when: nginx_branch == "mainline"
297-
298-
- name: Set NGINX stable version 1/2
299-
set_fact:
300-
nginx_version: "{{ nginx_versions.content | regex_search('stable[^<]*') | regex_replace('stable', 'release') }}"
301-
when: nginx_branch == "stable"
302-
303-
- name: Set NGINX stable version 2/2
304-
set_fact:
305-
nginx_version: "{{ nginx_versions.content | regex_search(nginx_version + '[^<]*') | regex_replace('release', 'nginx') }}"
306-
when: nginx_branch == "stable"
307-
308-
- name: Set NGINX download filename
309-
set_fact:
310-
nginx_download_name: "{{ nginx_version }}"
295+
nginx_version: "{{ 'nginx-' + (nginx_versions.content | regex_search('([0-9]+\\.){2}[0-9]+')) }}"
311296

312297
- name: Check for NGINX install
313298
stat:
@@ -323,8 +308,8 @@
323308
block:
324309
- name: Download NGINX
325310
get_url:
326-
url: "https://nginx.org/download/{{ nginx_download_name }}.tar.gz"
327-
dest: "/tmp/{{ nginx_download_name }}.tar.gz"
311+
url: "https://nginx.org/download/{{ nginx_version }}.tar.gz"
312+
dest: "/tmp/{{ nginx_version }}.tar.gz"
328313
mode: 0600
329314
validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '=='))
330315
| ternary('no', 'yes') }}"

0 commit comments

Comments
 (0)