Skip to content

Commit a528e23

Browse files
authored
Update Molecule CI/CD to support NGINX 1.25.2 (#649)
1 parent 2d0843a commit a528e23

File tree

22 files changed

+203
-176
lines changed

22 files changed

+203
-176
lines changed

CHANGELOG.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 0.24.2 (Unreleased)
4+
5+
FEATURES:
6+
7+
- Add Alpine Linux 3.18 and Debian bookworm to the list of NGINX Plus tested and supported distributions.
8+
- Remove Alpine Linux 3.14 and Ubuntu bionic from the list of NGINX Plus tested and supported distributions.
9+
- The `geoip2` module for NGINX Plus is no longer supported on Amazon Linux.
10+
11+
CI/CD:
12+
13+
- Reimplement some platforms in the upgrade & downgrade Molecule scenarios since all platforms now have at least two releases.
14+
- Replace the hardcoded NGINX version check in multiple Molecule scenarios with a dynamic NGINX version check.
15+
316
## 0.24.1 (July 6, 2023)
417

518
FEATURES:
@@ -18,11 +31,11 @@ ENHANCEMENTS:
1831

1932
BUG FIXES:
2033

21-
- Fix an issue with the platform validation logic whereas distro versions ending in `*.*0` would not be correctly identified.
34+
- Fix an issue with the platform validation logic where distribution versions ending in `*.*0` would not be correctly identified.
2235

2336
CI/CD:
2437

25-
- Comment out the platform parameter out of Molecule tests. QEMU based tests are failing when trying to test the newest supported distros.
38+
- Comment out the platform parameter out of Molecule tests. QEMU based tests are failing when trying to test the newest supported distribution.
2639
- Split Ansible Lint into its own GitHub Actions job since Molecule no longer runs linters natively.
2740
- Replace `molecule[docker]` with `molecule` and `molecule-plugins[docker]`.
2841
- Explicitly set the `ansible-compat` version (commented out for the time being whilst waiting for a new release of Molecule).

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,17 @@ AlmaLinux:
132132
- 8
133133
- 9
134134
Alpine:
135-
- 3.14
136135
- 3.15
137136
- 3.16
138137
- 3.17
138+
- 3.18
139139
Amazon Linux:
140140
- 2
141141
CentOS:
142142
- 7.4+
143143
Debian:
144144
- bullseye (11)
145+
- bookworm (12)
145146
FreeBSD:
146147
- 12.1+
147148
- 13
@@ -160,7 +161,6 @@ SUSE/SLES:
160161
- 12
161162
- 15
162163
Ubuntu:
163-
- bionic (18.04)
164164
- focal (20.04)
165165
- jammy (22.04)
166166
```

molecule/default/verify.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,16 @@
2424
url: http://localhost
2525
status_code: 200
2626

27-
- name: Verify correct version of NGINX has been installed
27+
- name: Fetch the latest mainline version of NGINX
28+
ansible.builtin.uri:
29+
url: https://version.nginx.com/nginx/mainline
30+
return_content: true
31+
register: nginx_version
32+
33+
- name: Verify the latest mainline version of NGINX has been installed
2834
ansible.builtin.command: nginx -v
2935
args:
3036
chdir: "{{ ((ansible_facts['system'] | lower is not search('bsd')) | ternary('/etc/nginx', '/usr/local/sbin')) }}"
3137
changed_when: false
3238
register: version
33-
failed_when: version is not search('1.25.1')
39+
failed_when: version is not search(nginx_version['content'] | regex_search('([0-9]+\\.){2}[0-9]+'))

molecule/downgrade-plus/converge.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
pre_tasks:
55
- name: Set repo if Alpine
66
ansible.builtin.set_fact:
7-
version: =27-r1
7+
version: =29-r1
88
when: ansible_facts['os_family'] == "Alpine"
99
- name: Set repo if Debian
1010
ansible.builtin.set_fact:
11-
version: =27-1~{{ ansible_facts['distribution_release'] }}
11+
version: =29-1~{{ ansible_facts['distribution_release'] }}
1212
when: ansible_facts['os_family'] == "Debian"
1313
- name: Set repo if Red Hat
1414
ansible.builtin.set_fact:
15-
version: -27-1.{{ (ansible_facts['distribution'] == "Amazon") | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx
15+
version: -29-1.{{ (ansible_facts['distribution'] == "Amazon") | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx
1616
when: ansible_facts['os_family'] == "RedHat"
1717
- name: Set repo if SLES
1818
ansible.builtin.set_fact:
19-
version: =27-1.sles{{ ansible_facts['distribution_major_version'] }}.ngx
19+
version: =29-1.sles{{ ansible_facts['distribution_major_version'] }}.ngx
2020
when: ansible_facts['os_family'] == "Suse"
2121
tasks:
2222
- name: Install NGINX

molecule/downgrade-plus/molecule.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
driver:
33
name: docker
4-
platforms: # Alpine 3.17 only has one version of NGINX Plus available (at the moment) so it's impossible to test the downgrade scenario
4+
platforms: # Alpine 3.18 and Debian bookworm only have one version of NGINX Plus available (at the moment) so it's impossible to test the downgrade scenario
55
- name: almalinux-8
66
image: almalinux:8
77
dockerfile: ../common/Dockerfile.j2
@@ -18,34 +18,34 @@ platforms: # Alpine 3.17 only has one version of NGINX Plus available (at the mo
1818
volumes:
1919
- /sys/fs/cgroup:/sys/fs/cgroup:rw
2020
command: /usr/sbin/init
21-
- name: alpine-3.14
22-
image: alpine:3.14
21+
- name: alpine-3.15
22+
image: alpine:3.15
2323
dockerfile: ../common/Dockerfile.j2
2424
privileged: true
2525
cgroupns_mode: host
2626
volumes:
2727
- /sys/fs/cgroup:/sys/fs/cgroup:rw
2828
command: /sbin/init
29-
- name: alpine-3.15
30-
image: alpine:3.15
29+
- name: alpine-3.16
30+
image: alpine:3.16
31+
# platform: x86_64
3132
dockerfile: ../common/Dockerfile.j2
3233
privileged: true
3334
cgroupns_mode: host
3435
volumes:
3536
- /sys/fs/cgroup:/sys/fs/cgroup:rw
3637
command: /sbin/init
37-
- name: alpine-3.16
38-
image: alpine:3.16
39-
# platform: x86_64
38+
- name: alpine-3.17
39+
image: alpine:3.17
40+
# platform: aarch64
4041
dockerfile: ../common/Dockerfile.j2
4142
privileged: true
4243
cgroupns_mode: host
4344
volumes:
4445
- /sys/fs/cgroup:/sys/fs/cgroup:rw
4546
command: /sbin/init
46-
# - name: alpine-3.17
47-
# image: alpine:3.17
48-
# platform: aarch64
47+
# - name: alpine-3.18
48+
# image: alpine:3.18
4949
# dockerfile: ../common/Dockerfile.j2
5050
# privileged: true
5151
# cgroupns_mode: host
@@ -78,6 +78,14 @@ platforms: # Alpine 3.17 only has one version of NGINX Plus available (at the mo
7878
volumes:
7979
- /sys/fs/cgroup:/sys/fs/cgroup:rw
8080
command: /sbin/init
81+
# - name: debian-bookworm
82+
# image: debian:bookworm-slim
83+
# dockerfile: ../common/Dockerfile.j2
84+
# privileged: true
85+
# cgroupns_mode: host
86+
# volumes:
87+
# - /sys/fs/cgroup:/sys/fs/cgroup:rw
88+
# command: /sbin/init
8189
- name: oraclelinux-7
8290
image: oraclelinux:7
8391
# platform: x86_64
@@ -155,15 +163,6 @@ platforms: # Alpine 3.17 only has one version of NGINX Plus available (at the mo
155163
volumes:
156164
- /sys/fs/cgroup:/sys/fs/cgroup:rw
157165
command: /usr/sbin/init
158-
- name: ubuntu-bionic
159-
image: ubuntu:bionic
160-
# platform: x86_64
161-
dockerfile: ../common/Dockerfile.j2
162-
privileged: true
163-
cgroupns_mode: host
164-
volumes:
165-
- /sys/fs/cgroup:/sys/fs/cgroup:rw
166-
command: /sbin/init
167166
- name: ubuntu-focal
168167
image: ubuntu:focal
169168
# platform: s390x

molecule/downgrade-plus/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
chdir: "{{ ((ansible_facts['system'] | lower is not search('bsd')) | ternary('/etc/nginx', '/usr/local/sbin')) }}"
3131
changed_when: false
3232
register: version
33-
failed_when: version is not search('27')
33+
failed_when: version is not search('29')

molecule/downgrade/converge.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
pre_tasks:
55
- name: Set repo if Alpine
66
ansible.builtin.set_fact:
7-
version: =1.23.2-r1
7+
version: =1.25.1-r1
88
when: ansible_facts['os_family'] == "Alpine"
99
- name: Set repo if Debian
1010
ansible.builtin.set_fact:
11-
version: =1.23.2-1~{{ ansible_facts['distribution_release'] }}
11+
version: =1.25.1-1~{{ ansible_facts['distribution_release'] }}
1212
when: ansible_facts['os_family'] == "Debian"
1313
- name: Set repo if Red Hat
1414
ansible.builtin.set_fact:
15-
version: -1.23.2-1.{{ (ansible_facts['distribution'] == "Amazon") | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx
15+
version: -1.25.1-1.{{ (ansible_facts['distribution'] == "Amazon") | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx
1616
when: ansible_facts['os_family'] == "RedHat"
1717
- name: Set repo if SLES
1818
ansible.builtin.set_fact:
19-
version: =1.23.2-1.sles{{ ansible_facts['distribution_major_version'] }}.ngx
19+
version: =1.25.1-1.sles{{ ansible_facts['distribution_major_version'] }}.ngx
2020
when: ansible_facts['os_family'] == "Suse"
2121
tasks:
2222
- name: Install NGINX

molecule/downgrade/molecule.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
driver:
33
name: docker
4-
platforms: # Alpine 3.18, Debian bookworm, and Ubuntu lunar only have one release for the time being
4+
platforms:
55
- name: almalinux-8
66
image: almalinux:8
77
dockerfile: ../common/Dockerfile.j2
@@ -44,14 +44,14 @@ platforms: # Alpine 3.18, Debian bookworm, and Ubuntu lunar only have one releas
4444
volumes:
4545
- /sys/fs/cgroup:/sys/fs/cgroup:rw
4646
command: /sbin/init
47-
# - name: alpine-3.18
48-
# image: alpine:3.18
49-
# dockerfile: ../common/Dockerfile.j2
50-
# privileged: true
51-
# cgroupns_mode: host
52-
# volumes:
53-
# - /sys/fs/cgroup:/sys/fs/cgroup:rw
54-
# command: /sbin/init
47+
- name: alpine-3.18
48+
image: alpine:3.18
49+
dockerfile: ../common/Dockerfile.j2
50+
privileged: true
51+
cgroupns_mode: host
52+
volumes:
53+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
54+
command: /sbin/init
5555
- name: amazonlinux-2
5656
image: amazonlinux:2
5757
# platform: x86_64
@@ -78,14 +78,14 @@ platforms: # Alpine 3.18, Debian bookworm, and Ubuntu lunar only have one releas
7878
volumes:
7979
- /sys/fs/cgroup:/sys/fs/cgroup:rw
8080
command: /sbin/init
81-
# - name: debian-bookworm
82-
# image: debian:bookworm-slim
83-
# dockerfile: ../common/Dockerfile.j2
84-
# privileged: true
85-
# cgroupns_mode: host
86-
# volumes:
87-
# - /sys/fs/cgroup:/sys/fs/cgroup:rw
88-
# command: /sbin/init
81+
- name: debian-bookworm
82+
image: debian:bookworm-slim
83+
dockerfile: ../common/Dockerfile.j2
84+
privileged: true
85+
cgroupns_mode: host
86+
volumes:
87+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
88+
command: /sbin/init
8989
- name: oraclelinux-7
9090
image: oraclelinux:7
9191
# platform: x86_64
@@ -190,14 +190,14 @@ platforms: # Alpine 3.18, Debian bookworm, and Ubuntu lunar only have one releas
190190
volumes:
191191
- /sys/fs/cgroup:/sys/fs/cgroup:rw
192192
command: /sbin/init
193-
# - name: ubuntu-lunar
194-
# image: ubuntu:lunar
195-
# dockerfile: ../common/Dockerfile.j2
196-
# privileged: true
197-
# cgroupns_mode: host
198-
# volumes:
199-
# - /sys/fs/cgroup:/sys/fs/cgroup:rw
200-
# command: /sbin/init
193+
- name: ubuntu-lunar
194+
image: ubuntu:lunar
195+
dockerfile: ../common/Dockerfile.j2
196+
privileged: true
197+
cgroupns_mode: host
198+
volumes:
199+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
200+
command: /sbin/init
201201
provisioner:
202202
name: ansible
203203
log: true

molecule/downgrade/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
chdir: "{{ ((ansible_facts['system'] | lower is not search('bsd')) | ternary('/etc/nginx', '/usr/local/sbin')) }}"
3131
changed_when: false
3232
register: version
33-
failed_when: version is not search('1.23.2')
33+
failed_when: version is not search('1.25.1')

molecule/plus/molecule.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ platforms:
1818
volumes:
1919
- /sys/fs/cgroup:/sys/fs/cgroup:rw
2020
command: /usr/sbin/init
21-
- name: alpine-3.14
22-
image: alpine:3.14
23-
dockerfile: ../common/Dockerfile.j2
24-
privileged: true
25-
cgroupns_mode: host
26-
volumes:
27-
- /sys/fs/cgroup:/sys/fs/cgroup:rw
28-
command: /sbin/init
2921
- name: alpine-3.15
3022
image: alpine:3.15
3123
dockerfile: ../common/Dockerfile.j2
@@ -52,6 +44,14 @@ platforms:
5244
volumes:
5345
- /sys/fs/cgroup:/sys/fs/cgroup:rw
5446
command: /sbin/init
47+
- name: alpine-3.18
48+
image: alpine:3.18
49+
dockerfile: ../common/Dockerfile.j2
50+
privileged: true
51+
cgroupns_mode: host
52+
volumes:
53+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
54+
command: /sbin/init
5555
- name: amazonlinux-2
5656
image: amazonlinux:2
5757
# platform: x86_64
@@ -78,6 +78,14 @@ platforms:
7878
volumes:
7979
- /sys/fs/cgroup:/sys/fs/cgroup:rw
8080
command: /sbin/init
81+
- name: debian-bookworm
82+
image: debian:bookworm-slim
83+
dockerfile: ../common/Dockerfile.j2
84+
privileged: true
85+
cgroupns_mode: host
86+
volumes:
87+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
88+
command: /sbin/init
8189
- name: oraclelinux-7
8290
image: oraclelinux:7
8391
# platform: x86_64
@@ -155,15 +163,6 @@ platforms:
155163
volumes:
156164
- /sys/fs/cgroup:/sys/fs/cgroup:rw
157165
command: /usr/sbin/init
158-
- name: ubuntu-bionic
159-
image: ubuntu:bionic
160-
# platform: x86_64
161-
dockerfile: ../common/Dockerfile.j2
162-
privileged: true
163-
cgroupns_mode: host
164-
volumes:
165-
- /sys/fs/cgroup:/sys/fs/cgroup:rw
166-
command: /sbin/init
167166
- name: ubuntu-focal
168167
image: ubuntu:focal
169168
# platform: s390x

molecule/plus/verify.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,17 @@
2323
ansible.builtin.uri:
2424
url: http://localhost
2525
status_code: 200
26+
27+
- name: Fetch the latest version of NGINX Plus
28+
ansible.builtin.uri:
29+
url: https://version.nginx.com/plus
30+
return_content: true
31+
register: nginx_version
32+
33+
- name: Verify the latest version of NGINX Plus has been installed
34+
ansible.builtin.command: nginx -v
35+
args:
36+
chdir: "{{ ((ansible_facts['system'] | lower is not search('bsd')) | ternary('/etc/nginx', '/usr/local/sbin')) }}"
37+
changed_when: false
38+
register: version
39+
failed_when: version is not search(nginx_version['content'] | regex_search('[0-9]+'))

molecule/stable/verify.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,16 @@
2424
url: http://localhost
2525
status_code: 200
2626

27-
- name: Verify correct version of NGINX has been installed
27+
- name: Fetch the latest stable version of NGINX
28+
ansible.builtin.uri:
29+
url: https://version.nginx.com/nginx/stable
30+
return_content: true
31+
register: nginx_version
32+
33+
- name: Verify the latest stable version of NGINX has been installed
2834
ansible.builtin.command: nginx -v
2935
args:
3036
chdir: "{{ ((ansible_facts['system'] | lower is not search('bsd')) | ternary('/etc/nginx', '/usr/local/sbin')) }}"
3137
changed_when: false
3238
register: version
33-
failed_when: version is not search('1.24.0')
39+
failed_when: version is not search(nginx_version['content'] | regex_search('([0-9]+\\.){2}[0-9]+'))

0 commit comments

Comments
 (0)