Skip to content

Commit 7f85d54

Browse files
authored
Update Molecule to remove Alpine Linux 3.15 (#697)
* And refactor Molecule downgrade scenario version checks to automate them
1 parent 0adefc2 commit 7f85d54

File tree

31 files changed

+168
-140
lines changed

31 files changed

+168
-140
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
FEATURES:
66

7-
- Add Alpine Linux 3.19 to the list of NGINX Plus tested and supported distributions.
8-
- Remove Alpine Linux 3.15 from the list of NGINX Plus tested and supported distributions.
7+
- Add Alpine Linux 3.19 to the list of NGINX Open Source and NGINX Plus tested and supported distributions.
8+
- Remove Alpine Linux 3.15 from the list of NGINX Open Source and NGINX Plus tested and supported distributions.
99

1010
ENHANCEMENTS:
1111

@@ -19,7 +19,8 @@ BUG FIXES:
1919
CI/CD:
2020

2121
- Add Molecule tests for NGINX Amplify.
22-
- Use the local role name (`ansible-role-nginx`) instead of the fully qualified role name (`nginxinc.nginx`) in Molecule to ensure tests always work as intended in environments where the role has been already installed beforehand.
22+
- Update the RHEL based tests to use the latest UBI release.
23+
- Use the local role name (`ansible-role-nginx`) instead of the fully qualified role name (`nginxinc.nginx`) in Molecule to ensure tests always work as intended in environments where the role has been already installed beforehand.
2324

2425
## 0.24.2 (October 3rd, 2023)
2526

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ AlmaLinux:
9494
- 8
9595
- 9
9696
Alpine:
97-
- 3.15
9897
- 3.16
9998
- 3.17
10099
- 3.18
100+
- 3.19
101101
Amazon Linux:
102102
- 2
103103
CentOS:

molecule/amplify/cleanup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
- name: Containers are not up, quit from here
1616
ansible.builtin.fail:
17-
when: container['failed']
17+
when: container['failed'] | bool
1818

1919
- name: Gather facts
2020
ansible.builtin.setup:

molecule/amplify/molecule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ platforms:
2828
- /sys/fs/cgroup:/sys/fs/cgroup:rw
2929
command: /usr/sbin/init
3030
- name: rhel-9
31-
image: redhat/ubi9:9.1.0
31+
image: redhat/ubi9:9.3
3232
# platform: aarch64
3333
dockerfile: ../common/Dockerfile.j2
3434
privileged: true

molecule/default/molecule.yml

Lines changed: 10 additions & 10 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.15
22-
image: alpine:3.15
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.16
3022
image: alpine:3.16
3123
platform: x86_64
@@ -52,6 +44,14 @@ platforms:
5244
volumes:
5345
- /sys/fs/cgroup:/sys/fs/cgroup:rw
5446
command: /sbin/init
47+
- name: alpine-3.19
48+
image: alpine:3.19
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
@@ -121,7 +121,7 @@ platforms:
121121
- /sys/fs/cgroup:/sys/fs/cgroup:rw
122122
command: /usr/sbin/init
123123
- name: rhel-8
124-
image: redhat/ubi8:8.7
124+
image: redhat/ubi8:8.9
125125
# platform: s390x
126126
dockerfile: ../common/Dockerfile.j2
127127
privileged: true
@@ -130,7 +130,7 @@ platforms:
130130
- /sys/fs/cgroup:/sys/fs/cgroup:rw
131131
command: /usr/sbin/init
132132
- name: rhel-9
133-
image: redhat/ubi9:9.1.0
133+
image: redhat/ubi9:9.3
134134
# platform: aarch64
135135
dockerfile: ../common/Dockerfile.j2
136136
privileged: true

molecule/distribution/molecule.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ platforms: # The RHEL UBI 7 image fails to install some NGINX dependencies when
1818
volumes:
1919
- /sys/fs/cgroup:/sys/fs/cgroup:rw
2020
command: /usr/sbin/init
21-
- name: alpine-3.15
22-
image: alpine:3.15
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.16
3022
image: alpine:3.16
3123
platform: x86_64
@@ -52,6 +44,14 @@ platforms: # The RHEL UBI 7 image fails to install some NGINX dependencies when
5244
volumes:
5345
- /sys/fs/cgroup:/sys/fs/cgroup:rw
5446
command: /sbin/init
47+
- name: alpine-3.19
48+
image: alpine:3.19
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
@@ -121,7 +121,7 @@ platforms: # The RHEL UBI 7 image fails to install some NGINX dependencies when
121121
# - /sys/fs/cgroup:/sys/fs/cgroup:rw
122122
# command: /usr/sbin/init
123123
- name: rhel-8
124-
image: redhat/ubi8:8.7
124+
image: redhat/ubi8:8.9
125125
# platform: s390x
126126
dockerfile: ../common/Dockerfile.j2
127127
privileged: true
@@ -130,7 +130,7 @@ platforms: # The RHEL UBI 7 image fails to install some NGINX dependencies when
130130
- /sys/fs/cgroup:/sys/fs/cgroup:rw
131131
command: /usr/sbin/init
132132
- name: rhel-9
133-
image: redhat/ubi9:9.1.0
133+
image: redhat/ubi9:9.3
134134
# platform: aarch64
135135
dockerfile: ../common/Dockerfile.j2
136136
privileged: true

molecule/downgrade-plus/converge.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@
55
- name: Set repo if Alpine
66
ansible.builtin.set_fact:
77
version: =30-r1
8+
cacheable: true
89
when: ansible_facts['os_family'] == "Alpine"
910
- name: Set repo if Debian
1011
ansible.builtin.set_fact:
1112
version: =30-1~{{ ansible_facts['distribution_release'] }}
13+
cacheable: true
1214
when: ansible_facts['os_family'] == "Debian"
1315
- name: Set repo if Red Hat
1416
ansible.builtin.set_fact:
1517
version: -30-1.{{ (ansible_facts['distribution'] == "Amazon") | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx
18+
cacheable: true
1619
when: ansible_facts['os_family'] == "RedHat"
1720
- name: Set repo if SLES
1821
ansible.builtin.set_fact:
1922
version: =30-1.sles{{ ansible_facts['distribution_major_version'] }}.ngx
23+
cacheable: true
2024
when: ansible_facts['os_family'] == "Suse"
2125
tasks:
2226
- name: Install NGINX

molecule/downgrade-plus/molecule.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ platforms: # Alpine 3.19 only has one version of NGINX Plus available (at the mo
121121
- /sys/fs/cgroup:/sys/fs/cgroup:rw
122122
command: /usr/sbin/init
123123
- name: rhel-8
124-
image: redhat/ubi8:8.7
124+
image: redhat/ubi8:8.9
125125
# platform: s390x
126126
dockerfile: ../common/Dockerfile.j2
127127
privileged: true
@@ -130,7 +130,7 @@ platforms: # Alpine 3.19 only has one version of NGINX Plus available (at the mo
130130
- /sys/fs/cgroup:/sys/fs/cgroup:rw
131131
command: /usr/sbin/init
132132
- name: rhel-9
133-
image: redhat/ubi9:9.1.0
133+
image: redhat/ubi9:9.3
134134
# platform: aarch64
135135
dockerfile: ../common/Dockerfile.j2
136136
privileged: true
@@ -187,3 +187,8 @@ provisioner:
187187
prepare: prepare.yml
188188
converge: converge.yml
189189
verify: verify.yml
190+
config_options:
191+
defaults:
192+
fact_caching: jsonfile
193+
fact_caching_connection: /tmp/facts_cache
194+
fact_caching_timeout: 7200

molecule/downgrade-plus/prepare.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
hosts: localhost
44
gather_facts: false
55
tasks:
6-
- name: Create ephemeral license certificate file from b64 decoded env var # noqa template-instead-of-copy
6+
- name: Create ephemeral license certificate file from b64 decoded env var
77
ansible.builtin.copy:
88
content: "{{ lookup('env', 'NGINX_CRT') | b64decode }}"
99
dest: ../../files/license/nginx-repo.crt
1010
force: false
1111
mode: "0444"
1212

13-
- name: Create ephemeral license key file from b64 decoded env var # noqa template-instead-of-copy
13+
- name: Create ephemeral license key file from b64 decoded env var
1414
ansible.builtin.copy:
1515
content: "{{ lookup('env', 'NGINX_KEY') | b64decode }}"
1616
dest: ../../files/license/nginx-repo.key
@@ -22,7 +22,7 @@
2222
tasks:
2323
- name: Install NGINX
2424
ansible.builtin.include_role:
25-
name: nginxinc.nginx
25+
name: ansible-role-nginx
2626
vars:
2727
nginx_type: plus
2828
nginx_license:

molecule/downgrade-plus/verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
args:
3030
chdir: "{{ ((ansible_facts['system'] | lower is not search('bsd')) | ternary('/etc/nginx', '/usr/local/sbin')) }}"
3131
changed_when: false
32-
register: version
33-
failed_when: version is not search('30')
32+
register: current_version
33+
failed_when: current_version is not search(version | regex_search('[0-9]+'))

molecule/downgrade/converge.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@
44
pre_tasks:
55
- name: Set repo if Alpine
66
ansible.builtin.set_fact:
7-
version: =1.25.1-r1
7+
version: =1.25.3-r1
8+
cacheable: true
89
when: ansible_facts['os_family'] == "Alpine"
910
- name: Set repo if Debian
1011
ansible.builtin.set_fact:
11-
version: =1.25.1-1~{{ ansible_facts['distribution_release'] }}
12+
version: =1.25.3-1~{{ ansible_facts['distribution_release'] }}
13+
cacheable: true
1214
when: ansible_facts['os_family'] == "Debian"
1315
- name: Set repo if Red Hat
1416
ansible.builtin.set_fact:
15-
version: -1.25.1-1.{{ (ansible_facts['distribution'] == "Amazon") | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx
17+
version: -1.25.3-1.{{ (ansible_facts['distribution'] == "Amazon") | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx
18+
cacheable: true
1619
when: ansible_facts['os_family'] == "RedHat"
1720
- name: Set repo if SLES
1821
ansible.builtin.set_fact:
19-
version: =1.25.1-1.sles{{ ansible_facts['distribution_major_version'] }}.ngx
22+
version: =1.25.3-1.sles{{ ansible_facts['distribution_major_version'] }}.ngx
23+
cacheable: true
2024
when: ansible_facts['os_family'] == "Suse"
2125
tasks:
2226
- name: Install NGINX

molecule/downgrade/molecule.yml

Lines changed: 15 additions & 10 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.15
22-
image: alpine:3.15
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.16
3022
image: alpine:3.16
3123
platform: x86_64
@@ -52,6 +44,14 @@ platforms:
5244
volumes:
5345
- /sys/fs/cgroup:/sys/fs/cgroup:rw
5446
command: /sbin/init
47+
- name: alpine-3.19
48+
image: alpine:3.19
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
@@ -121,7 +121,7 @@ platforms:
121121
- /sys/fs/cgroup:/sys/fs/cgroup:rw
122122
command: /usr/sbin/init
123123
- name: rhel-8
124-
image: redhat/ubi8:8.7
124+
image: redhat/ubi8:8.9
125125
# platform: s390x
126126
dockerfile: ../common/Dockerfile.j2
127127
privileged: true
@@ -130,7 +130,7 @@ platforms:
130130
- /sys/fs/cgroup:/sys/fs/cgroup:rw
131131
command: /usr/sbin/init
132132
- name: rhel-9
133-
image: redhat/ubi9:9.1.0
133+
image: redhat/ubi9:9.3
134134
# platform: aarch64
135135
dockerfile: ../common/Dockerfile.j2
136136
privileged: true
@@ -196,3 +196,8 @@ provisioner:
196196
prepare: prepare.yml
197197
converge: converge.yml
198198
verify: verify.yml
199+
config_options:
200+
defaults:
201+
fact_caching: jsonfile
202+
fact_caching_connection: /tmp/facts_cache
203+
fact_caching_timeout: 7200

molecule/downgrade/prepare.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
tasks:
55
- name: Install NGINX
66
ansible.builtin.include_role:
7-
name: nginxinc.nginx
7+
name: ansible-role-nginx

molecule/downgrade/verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
args:
3030
chdir: "{{ ((ansible_facts['system'] | lower is not search('bsd')) | ternary('/etc/nginx', '/usr/local/sbin')) }}"
3131
changed_when: false
32-
register: version
33-
failed_when: version is not search('1.25.1')
32+
register: current_version
33+
failed_when: current_version is not search(version | regex_search('([0-9]+\\.){2}[0-9]+'))

molecule/plus/molecule.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ platforms:
121121
- /sys/fs/cgroup:/sys/fs/cgroup:rw
122122
command: /usr/sbin/init
123123
- name: rhel-8
124-
image: redhat/ubi8:8.7
124+
image: redhat/ubi8:8.9
125125
# platform: s390x
126126
dockerfile: ../common/Dockerfile.j2
127127
privileged: true
@@ -130,7 +130,7 @@ platforms:
130130
- /sys/fs/cgroup:/sys/fs/cgroup:rw
131131
command: /usr/sbin/init
132132
- name: rhel-9
133-
image: redhat/ubi9:9.1.0
133+
image: redhat/ubi9:9.3
134134
# platform: aarch64
135135
dockerfile: ../common/Dockerfile.j2
136136
privileged: true

molecule/plus/prepare.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
hosts: localhost
44
gather_facts: false
55
tasks:
6-
- name: Create ephemeral license certificate file from b64 decoded env var # noqa template-instead-of-copy
6+
- name: Create ephemeral license certificate file from b64 decoded env var
77
ansible.builtin.copy:
88
content: "{{ lookup('env', 'NGINX_CRT') | b64decode }}"
99
dest: ../../files/license/nginx-repo.crt
1010
force: false
1111
mode: "0444"
1212

13-
- name: Create ephemeral license key file from b64 decoded env var # noqa template-instead-of-copy
13+
- name: Create ephemeral license key file from b64 decoded env var
1414
ansible.builtin.copy:
1515
content: "{{ lookup('env', 'NGINX_KEY') | b64decode }}"
1616
dest: ../../files/license/nginx-repo.key

0 commit comments

Comments
 (0)