Skip to content

Commit 8be0e37

Browse files
authored
Add Ubuntu jammy to downgrade and upgrade tests (#528)
1 parent c0def6c commit 8be0e37

File tree

6 files changed

+31
-14
lines changed

6 files changed

+31
-14
lines changed

molecule/downgrade/converge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
pre_tasks:
55
- name: Set repo if Debian
66
ansible.builtin.set_fact:
7-
version: "=1.20.2-1~{{ ansible_facts['distribution_release'] }}"
7+
version: "=1.22.0-1~{{ ansible_facts['distribution_release'] }}"
88
when: ansible_facts['os_family'] == "Debian"
99
- name: Set repo if Red Hat
1010
ansible.builtin.set_fact:
11-
version: "-1.20.2-1.{{ (ansible_facts['distribution'] == 'Amazon') | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx"
11+
version: "-1.22.0-1.{{ (ansible_facts['distribution'] == 'Amazon') | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx"
1212
when: ansible_facts['os_family'] == "RedHat"
1313
tasks:
1414
- name: Install NGINX

molecule/downgrade/molecule.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ platforms:
6969
volumes:
7070
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
7171
command: "/sbin/init"
72+
- name: ubuntu-jammy
73+
image: ubuntu:jammy
74+
dockerfile: ../common/Dockerfile.j2
75+
privileged: true
76+
volumes:
77+
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
78+
command: "/sbin/init"
7279
provisioner:
7380
name: ansible
7481
playbooks:

molecule/downgrade/prepare.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22
- name: Prepare
33
hosts: all
44
pre_tasks:
5-
- name: Set repo if Alpine
6-
ansible.builtin.set_fact:
7-
version: "=1.21.5-r1"
8-
when: ansible_facts['os_family'] == "Alpine"
95
- name: Set repo if Debian
106
ansible.builtin.set_fact:
11-
version: "=1.21.5-1~{{ ansible_facts['distribution_release'] }}"
7+
version: "=1.23.0-1~{{ ansible_facts['distribution_release'] }}"
128
when: ansible_facts['os_family'] == "Debian"
139
- name: Set repo if Red Hat
1410
ansible.builtin.set_fact:
15-
version: "-1.21.6-1.{{ (ansible_facts['distribution'] == 'Amazon') | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx"
11+
version: "-1.23.0-1.{{ (ansible_facts['distribution'] == 'Amazon') | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx"
1612
when: ansible_facts['os_family'] == "RedHat"
1713
tasks:
1814
- name: Install NGINX

molecule/downgrade/verify.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,21 @@
2424
url: http://localhost
2525
status_code: 200
2626

27+
- name: Fetch NGINX version
28+
ansible.builtin.uri:
29+
url: https://version.nginx.com/nginx/stable
30+
return_content: true
31+
check_mode: false
32+
register: nginx_versions
33+
34+
- name: Set NGINX version
35+
ansible.builtin.set_fact:
36+
nginx_version: "{{ nginx_versions.content | regex_search('([0-9]+\\.){2}[0-9]+') }}"
37+
2738
- name: Verify NGINX has been downgraded
2839
ansible.builtin.command: nginx -v
2940
args:
3041
chdir: "{{ ((ansible_facts['system'] | lower is not search('bsd')) | ternary('/etc/nginx', '/usr/local/sbin')) }}"
3142
changed_when: false
3243
register: version
33-
failed_when: version is not search('1.20.2')
44+
failed_when: version is not search(nginx_version)

molecule/upgrade/molecule.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ platforms:
6969
volumes:
7070
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
7171
command: "/sbin/init"
72+
- name: ubuntu-jammy
73+
image: ubuntu:jammy
74+
dockerfile: ../common/Dockerfile.j2
75+
privileged: true
76+
volumes:
77+
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
78+
command: "/sbin/init"
7279
provisioner:
7380
name: ansible
7481
playbooks:

molecule/upgrade/prepare.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
- name: Prepare
33
hosts: all
44
pre_tasks:
5-
- name: Set repo if Alpine
6-
ansible.builtin.set_fact:
7-
version: "=1.21.5-r1"
8-
when: ansible_facts['os_family'] == "Alpine"
95
- name: Set repo if Debian
106
ansible.builtin.set_fact:
11-
version: "=1.21.5-1~{{ ansible_facts['distribution_release'] }}"
7+
version: "=1.21.6-1~{{ ansible_facts['distribution_release'] }}"
128
when: ansible_facts['os_family'] == "Debian"
139
- name: Set repo if Red Hat
1410
ansible.builtin.set_fact:

0 commit comments

Comments
 (0)