Skip to content

Commit 099c836

Browse files
committed
Update CI/CD to support NGINX 1.25.2
1 parent 2d0843a commit 099c836

File tree

9 files changed

+85
-70
lines changed

9 files changed

+85
-70
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 0.24.2 (Unreleased)
4+
5+
CI/CD:
6+
7+
- Reimplement some platforms in the upgrade & downgrade Molecule scenarios since all platforms now have at least two releases.
8+
- Replace the hardcoded NGINX version check in multiple Molecule scenarios with a dynamic NGINX version check.
9+
310
## 0.24.1 (July 6, 2023)
411

512
FEATURES:

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 latest mainline version of NGINX
28+
ansible.builtin.uri:
29+
url: https://version.nginx.com/nginx/mainline
30+
return_content: true
31+
register: nginx_versions
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_versions['content'] | regex_search('([0-9]+\\.){2}[0-9]+'))

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/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 latest stable version of NGINX
28+
ansible.builtin.uri:
29+
url: https://version.nginx.com/nginx/stable
30+
return_content: true
31+
register: nginx_versions
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_versions['content'] | regex_search('([0-9]+\\.){2}[0-9]+'))

molecule/upgrade/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/upgrade/prepare.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/upgrade/verify.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,17 @@
2424
url: http://localhost
2525
status_code: 200
2626

27-
- name: Fetch NGINX version
27+
- name: Fetch latest mainline version of NGINX
2828
ansible.builtin.uri:
2929
url: https://version.nginx.com/nginx/mainline
3030
return_content: true
3131
check_mode: false
3232
register: nginx_versions
3333

34-
- name: Set NGINX version
35-
ansible.builtin.set_fact:
36-
nginx_version: "{{ nginx_versions.content | regex_search('([0-9]+\\.){2}[0-9]+') }}"
37-
38-
- name: Verify NGINX has been upgraded
34+
- name: Verify NGINX has been upgraded to the latest mainline version
3935
ansible.builtin.command: nginx -v
4036
args:
4137
chdir: "{{ ((ansible_facts['system'] | lower is not search('bsd')) | ternary('/etc/nginx', '/usr/local/sbin')) }}"
4238
changed_when: false
4339
register: version
44-
failed_when: version is not search(nginx_version)
40+
failed_when: version is not search(nginx_version['content'] | regex_search('([0-9]+\\.){2}[0-9]+'))

0 commit comments

Comments
 (0)