Skip to content

Commit 1cadc0b

Browse files
committed
Add stable and version Molecule scenarios (#581)
1 parent b1b7f92 commit 1cadc0b

File tree

26 files changed

+334
-54
lines changed

26 files changed

+334
-54
lines changed

.github/workflows/molecule.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ jobs:
2525
scenario:
2626
- default
2727
- downgrade
28-
- downgrade_plus
29-
- module
28+
- downgrade-plus
3029
- plus
3130
- source
31+
- stable
3232
- uninstall
33-
- uninstall_plus
33+
- uninstall-plus
3434
- upgrade
35-
- upgrade_plus
35+
- upgrade-plus
36+
- version
3637
steps:
3738
- name: Check out the codebase
3839
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ ENHANCEMENTS:
3131

3232
BUG FIXES:
3333

34+
* Specifying a module version would result in an invalid package name on Alpine Linux.
3435
* Fix an issue when installing the GeoIP2 module on an UBI 7 container where the the `libmaxminddb` package dependency might not be available via `yum` (if it's not available, `libmaxminddb` is installed from an external source).
3536
* GitHub actions should now correctly skip \*plus\* scenarios only when the NGINX Plus license secrets are not present.
3637
* Update the versions of the various packages required to build NGINX from source. The version of `zlib` listed in the role was no longer available.
@@ -40,8 +41,11 @@ BUG FIXES:
4041
TESTS:
4142

4243
* Update GitHub actions to run on Ubuntu 22.04 (and thus support `cgroups` v2).
43-
* Explicitly specify `x86_64`/`amd64` as the platform used in the Amazon Linux 2/CentOS/Oracle Linux/RHEL 7/SLES 15 Molecule Docker images. This will ensure that tests work when run on different host architectures (e.g. newer Macbooks with `aarch64`/`arm64` processors) when running tests in distributions that only support `x86_64` (either due to lack of support for a `cgroups` v2 backport or due to lack of builds for `aarch64`).
44+
* Explicitly specify `x86_64`/`amd64` as the platform used in the Amazon Linux 2/CentOS/Oracle Linux/RHEL 7/SLES 15 Molecule Docker images. This will ensure that tests work when run on different host architectures (e.g. newer Macbooks with `aarch64`/`arm64` processors) when running tests in distributions that only support `x86_64`/`amd64` (either due to lack of support for a `cgroups` v2 backport or due to lack of builds for `aarch64`/`arm64`).
4445
* Explicitly test some distributions using `aarch64` and `s390x` as the Molecule platform. This should ensure the role works as intended across the various architectures that are officially supported.
46+
* Combine the `module` Molecule scenario with the `default` scenario.
47+
* Add `stable` and `version` Molecule scenario.
48+
* Replace underscores with dashes in Molecule scenario names to improve naming consistency across the role.
4549

4650
## 0.23.2 (September 28, 2022)
4751

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,17 @@ Working functional playbook examples can be found in the **[`molecule/`](https:/
190190

191191
| Name | Description |
192192
| ---- | ----------- |
193-
| **[`default/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/default/converge.yml)** | Install a specific version of NGINX and set up logrotate |
193+
| **[`default/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/default/converge.yml)** | Install a specific version of NGINX, install various NGINX supported modules, tweak systemd and set up logrotate |
194194
| **[`downgrade/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/downgrade/converge.yml)** | Downgrade to a specific version of NGINX |
195-
| **[`downgrade_plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/downgrade_plus/converge.yml)** | Downgrade to a specific version of NGINX Plus |
196-
| **[`module/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/module/converge.yml)** | Install various NGINX supported modules |
195+
| **[`downgrade-plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/downgrade-plus/converge.yml)** | Downgrade to a specific version of NGINX Plus |
197196
| **[`plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/plus/converge.yml)** | Install NGINX Plus and various NGINX Plus supported modules |
198197
| **[`source/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/source/converge.yml)** | Install NGINX from source |
198+
| **[`stable/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/stable/converge.yml)** | Install NGINX using the latest stable release |
199199
| **[`uninstall/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/uninstall/converge.yml)** | Uninstall NGINX |
200-
| **[`uninstall_plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/uninstall_plus/converge.yml)** | Uninstall NGINX Plus |
200+
| **[`uninstall-plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/uninstall-plus/converge.yml)** | Uninstall NGINX Plus |
201201
| **[`upgrade/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/upgrade/converge.yml)** | Upgrade NGINX |
202-
| **[`upgrade_plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/upgrade_plus/converge.yml)** | Upgrade NGINX Plus |
202+
| **[`upgrade-plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/upgrade-plus/converge.yml)** | Upgrade NGINX Plus |
203+
| **[`version/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/version/converge.yml)** | Install a specific version of NGINX and various NGINX modules |
203204

204205
Do note that if you install this repository via Ansible Galaxy, you will have to replace the role variable in the sample playbooks from `ansible-role-nginx` to `nginxinc.nginx`.
205206

molecule/default/converge.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
11
---
22
- name: Converge
33
hosts: all
4-
pre_tasks:
5-
- name: Set repo if Alpine
6-
ansible.builtin.set_fact:
7-
version: =1.23.2-r1
8-
when: ansible_facts['os_family'] == "Alpine"
9-
- name: Set repo if Debian
10-
ansible.builtin.set_fact:
11-
version: =1.23.2-1~{{ ansible_facts['distribution_release'] }}
12-
when: ansible_facts['os_family'] == "Debian"
13-
- name: Set repo if Red Hat
14-
ansible.builtin.set_fact:
15-
version: -1.23.2-1.{{ (ansible_facts['distribution'] == "Amazon") | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx
16-
when: ansible_facts['os_family'] == "RedHat"
17-
- name: Set repo if SLES
18-
ansible.builtin.set_fact:
19-
version: =1.23.2-1.sles{{ ansible_facts['distribution_major_version'] }}.ngx
20-
when: ansible_facts['os_family'] == "Suse"
214
tasks:
225
- name: Install NGINX
236
ansible.builtin.include_role:
247
name: ansible-role-nginx
258
vars:
26-
nginx_version: "{{ version }}"
9+
nginx_modules:
10+
- brotli
11+
- geoip
12+
- image-filter
13+
- njs
14+
- perl
15+
- xslt
2716
nginx_service_modify: true
2817
nginx_service_timeout: 95
2918
nginx_logrotate_conf_enable: true

molecule/default/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.23.3')

molecule/module/converge.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)