Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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)

FEATURES:
Expand Down
25 changes: 5 additions & 20 deletions tasks/opensource/install-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,31 +283,16 @@
block:
- name: Fetch NGINX version
uri:
url: https://trac.nginx.org/nginx/browser
url: https://version.nginx.com/nginx/{{ nginx_branch }}
return_content: yes
validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '=='))
| ternary('no', 'yes') }}"
check_mode: no
register: nginx_versions

- name: Set NGINX mainline version
- name: Set NGINX version
set_fact:
nginx_version: "{{ nginx_versions.content | regex_search('release[^<]*') | regex_replace('release', 'nginx') }}"
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 }}"
nginx_version: "{{ 'nginx-' + (nginx_versions.content | regex_search('([0-9]+\\.){2}[0-9]+')) }}"

- name: Check for NGINX install
stat:
Expand All @@ -323,8 +308,8 @@
block:
- name: Download NGINX
get_url:
url: "https://nginx.org/download/{{ nginx_download_name }}.tar.gz"
dest: "/tmp/{{ nginx_download_name }}.tar.gz"
url: "https://nginx.org/download/{{ nginx_version }}.tar.gz"
dest: "/tmp/{{ nginx_version }}.tar.gz"
mode: 0600
validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '=='))
| ternary('no', 'yes') }}"
Expand Down