Skip to content

Commit ece31b1

Browse files
committed
feat: Improve Ansible/Jinja2 validation (#752)
1 parent eed6af8 commit ece31b1

File tree

8 files changed

+106
-97
lines changed

8 files changed

+106
-97
lines changed

.github/workflows/f5-cla.yml

+39-39
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
---
2-
name: F5 CLA
3-
on:
4-
issue_comment:
5-
types: [created]
6-
pull_request_target:
7-
types: [opened, closed, synchronize]
8-
permissions: read-all
9-
jobs:
10-
f5-cla:
11-
name: F5 CLA
12-
runs-on: ubuntu-24.04
13-
permissions:
14-
actions: write
15-
pull-requests: write
16-
statuses: write
17-
steps:
18-
- name: Run F5 Contributor License Agreement (CLA) assistant
19-
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have hereby read the F5 CLA and agree to its terms') || github.event_name == 'pull_request_target'
20-
uses: contributor-assistant/github-action@9340315624c6e16cef1f2c63bdeb0f0c49c6f474 # v2.4.0
21-
with:
22-
# Any pull request targeting the following branch will trigger a CLA check.
23-
branch: main
24-
# Path to the CLA document.
25-
path-to-document: https://github.com/f5/.github/blob/main/CLA/cla-markdown.md
26-
# Custom CLA messages.
27-
custom-notsigned-prcomment: '🎉 Thank you for your contribution! It appears you have not yet signed the F5 Contributor License Agreement (CLA), which is required for your changes to be incorporated into an F5 Open Source Software (OSS) project. Please kindly read the [F5 CLA](https://github.com/f5/.github/blob/main/CLA/cla-markdown.md) and reply on a new comment with the following text to agree:'
28-
custom-pr-sign-comment: 'I have hereby read the F5 CLA and agree to its terms'
29-
custom-allsigned-prcomment: '✅ All required contributors have signed the F5 CLA for this PR. Thank you!'
30-
# Remote repository storing CLA signatures.
31-
remote-organization-name: f5
32-
remote-repository-name: f5-cla-data
33-
path-to-signatures: signatures/signatures.json
34-
# Comma separated list of usernames for maintainers or any other individuals who should not be prompted for a CLA.
35-
allowlist: alessfg, oxpa, bot*
36-
# Do not lock PRs after a merge.
37-
lock-pullrequest-aftermerge: false
38-
env:
39-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-
PERSONAL_ACCESS_TOKEN: ${{ secrets.F5_CLA_TOKEN }}
2+
name: F5 CLA
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_target:
7+
types: [opened, closed, synchronize]
8+
permissions: read-all
9+
jobs:
10+
f5-cla:
11+
name: F5 CLA
12+
runs-on: ubuntu-24.04
13+
permissions:
14+
actions: write
15+
pull-requests: write
16+
statuses: write
17+
steps:
18+
- name: Run F5 Contributor License Agreement (CLA) assistant
19+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have hereby read the F5 CLA and agree to its terms') || github.event_name == 'pull_request_target'
20+
uses: contributor-assistant/github-action@9340315624c6e16cef1f2c63bdeb0f0c49c6f474 # v2.4.0
21+
with:
22+
# Any pull request targeting the following branch will trigger a CLA check.
23+
branch: main
24+
# Path to the CLA document.
25+
path-to-document: https://github.com/f5/.github/blob/main/CLA/cla-markdown.md
26+
# Custom CLA messages.
27+
custom-notsigned-prcomment: '🎉 Thank you for your contribution! It appears you have not yet signed the F5 Contributor License Agreement (CLA), which is required for your changes to be incorporated into an F5 Open Source Software (OSS) project. Please kindly read the [F5 CLA](https://github.com/f5/.github/blob/main/CLA/cla-markdown.md) and reply on a new comment with the following text to agree:'
28+
custom-pr-sign-comment: 'I have hereby read the F5 CLA and agree to its terms'
29+
custom-allsigned-prcomment: '✅ All required contributors have signed the F5 CLA for this PR. Thank you!'
30+
# Remote repository storing CLA signatures.
31+
remote-organization-name: f5
32+
remote-repository-name: f5-cla-data
33+
path-to-signatures: signatures/signatures.json
34+
# Comma separated list of usernames for maintainers or any other individuals who should not be prompted for a CLA.
35+
allowlist: alessfg, oxpa, bot*
36+
# Do not lock PRs after a merge.
37+
lock-pullrequest-aftermerge: false
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
PERSONAL_ACCESS_TOKEN: ${{ secrets.F5_CLA_TOKEN }}

.github/workflows/release.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
name: Release Drafter
3-
on:
4-
push:
5-
branches: [main]
6-
pull_request_target:
7-
types: [opened, reopened, synchronize]
8-
permissions: read-all
9-
jobs:
10-
release-draft:
11-
name: Update release draft
12-
runs-on: ubuntu-24.04
13-
permissions:
14-
contents: write
15-
pull-requests: write
16-
steps:
17-
- name: Run release drafter
18-
uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0
19-
env:
20-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2+
name: Release Drafter
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request_target:
7+
types: [opened, reopened, synchronize]
8+
permissions: read-all
9+
jobs:
10+
release-draft:
11+
name: Update release draft
12+
runs-on: ubuntu-24.04
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
steps:
17+
- name: Run release drafter
18+
uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ FEATURES:
1212
- Add support for installing NGINX Open Source on Alpine Linux 3.20.
1313
- Add support for installing NGINX Agent on Ubuntu noble.
1414
- Add validation tasks to check the Ansible version, the Jinja2 version, and whether the required Ansible collections for this role are installed.
15+
- Bump the minimum version of Ansible supported to `2.16`, whilst clarifying that Ansible `2.18` is not supported at this stage.
1516
- Bump the Ansible `community.general` collection to `9.2.0`, `community.crypto` collection to `2.21.1` and `community.docker` collection to `3.11.0`.
1617

1718
DOCUMENTATION:
@@ -28,6 +29,7 @@ CI/CD:
2829
- Update GitHub Actions to Ubuntu 24.04.
2930
- Switch GitHub Actions from using tags to release hashes.
3031
- Remove commented out Molecule platforms and GitHub Actions QEMU step for the time being. These changes will be reverted if multi-arch testing can be reinstated in GitHub Actions.
32+
- Bump the minimum version of Ansible supported on Ansible Galaxy to `2.16`.
3133
- Remove platform metadata from the Ansible Galaxy role metadata since platforms are no longer supported in Ansible Galaxy NG.
3234
- Implement OSSF Scorecard.
3335

@@ -62,7 +64,7 @@ CI/CD:
6264
- Add Molecule tests for NGINX Amplify.
6365
- Update the RHEL based tests to use the latest UBI release.
6466
- 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.
65-
- Implement F5 CLA signatures.
67+
- Implement F5 CLA.
6668
- Hardcode version of Python requests module given its propensity to break the Docker Python SDK.
6769

6870
## 0.24.2 (October 3rd, 2023)

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Follow this project's [Installation Guide](/README.md#Installation) to install A
2121

2222
### Project Structure
2323

24-
- The NGINX Ansible role is written in `yaml` and supports NGINX Open Source, NGINX Plus, NGINX Agent and NGINX Amplify.
24+
- The NGINX Ansible role is written in [`yaml`](https://yaml.org) and supports NGINX Open Source, NGINX Plus, NGINX Agent and NGINX Amplify.
2525
- The project follows the standard [Ansible role directory structure](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html):
2626
- The main "codebase" is found in the [`tasks/`](/tasks/) directory.
2727
- Variables can be found in [`defaults/main/`](/defaults/main/). The filenames in this directory highlight which variables are contained in each file.

README.md

+29-27
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ This will also ensure you are deploying/running this role with a fully tested ve
4545
#### Ansible core
4646

4747
- This role is developed and tested with [maintained](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) versions of Ansible core and Python.
48+
49+
***Note:** Ansible `2.18` does no longer support the `yum` module and as such, is not supported by this role until Amazon Linux 2 reaches EoL.*
4850
- When using Ansible core, you will also need to install the following Ansible collections:
4951

5052
```yaml
@@ -96,7 +98,7 @@ If you want to contribute to this role, you will also need to install Ansible Li
9698

9799
- Molecule is used to test the various functionalities of the role.
98100
- Instructions on how to install Molecule can be found in the [Molecule website](https://molecule.readthedocs.io/en/latest/installation.html). *You will also need to install the Molecule plugins package and the Docker Python SDK.*
99-
- To run any of the NGINX Plus Molecule tests, you must first copy your NGINX Plus license to the role's [`files/license`](https://github.com/nginxinc/ansible-role-nginx/blob/main/files/license/) directory.
101+
- To run any of the NGINX Plus Molecule tests, you must first copy your NGINX Plus license to the role's [`files/license`](/files/license/) directory.
100102

101103
You can alternatively add your NGINX Plus repository certificate and key to the local environment. Run the following commands to export these files as base64-encoded variables and execute the Molecule tests:
102104

@@ -292,44 +294,44 @@ Ubuntu:
292294

293295
## Role Variables
294296

295-
This role has multiple variables. The descriptions and defaults for all these variables can be found in the **[`defaults/main/`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/)** directory in the following files:
297+
This role has multiple variables. The descriptions and defaults for all these variables can be found in the **[`defaults/main/`](/defaults/main/)** directory in the following files:
296298

297299
| Name | Description |
298300
| ---- | ----------- |
299-
| **[`main.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/main.yml)** | NGINX installation variables |
300-
| **[`agent.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/agent.yml)** | NGINX Agent installation variables |
301-
| **[`amplify.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/amplify.yml)** | NGINX Amplify agent installation variables |
302-
| **[`bsd.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/bsd.yml)** | BSD installation variables |
303-
| **[`logrotate.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/logrotate.yml)** | Logrotate configuration variables |
304-
| **[`selinux.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/selinux.yml)** | SELinux configuration variables |
305-
| **[`systemd.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/systemd.yml)** | Systemd configuration variables |
301+
| **[`main.yml`](/defaults/main/main.yml)** | NGINX installation variables |
302+
| **[`agent.yml`](/defaults/main/agent.yml)** | NGINX Agent installation variables |
303+
| **[`amplify.yml`](/defaults/main/amplify.yml)** | NGINX Amplify agent installation variables |
304+
| **[`bsd.yml`](/defaults/main/bsd.yml)** | BSD installation variables |
305+
| **[`logrotate.yml`](/defaults/main/logrotate.yml)** | Logrotate configuration variables |
306+
| **[`selinux.yml`](/defaults/main/selinux.yml)** | SELinux configuration variables |
307+
| **[`systemd.yml`](/defaults/main/systemd.yml)** | Systemd configuration variables |
306308

307-
Similarly, descriptions and defaults for preset variables can be found in the **[`vars/`](https://github.com/nginxinc/ansible-role-nginx/blob/main/vars/)** directory in the following files:
309+
Similarly, descriptions and defaults for preset variables can be found in the **[`vars/`](/vars/)** directory in the following files:
308310

309311
| Name | Description |
310312
| ---- | ----------- |
311-
| **[`main.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/vars/main.yml)** | List of supported NGINX platforms, modules, and Linux installation variables |
313+
| **[`main.yml`](/vars/main.yml)** | List of supported NGINX platforms, modules, and Linux installation variables |
312314

313315
## Example Playbooks
314316

315-
Working functional playbook examples can be found in the **[`molecule/`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/)** folder in the following files:
317+
Working functional playbook examples can be found in the **[`molecule/`](/molecule/)** folder in the following files:
316318

317319
| Name | Description |
318320
| ---- | ----------- |
319-
| **[`agent/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/agent/converge.yml)** | Install and configure NGINX Agent to connect to the NGINX One SaaS control plane on F5 Distributed Cloud |
320-
| **[`amplify/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/amplify/converge.yml)** | Install and configure the NGINX Amplify agent |
321-
| **[`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 |
322-
| **[`distribution/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/distribution/converge.yml)** | Install NGINX from the distribution's package repository instead of NGINX's package repository |
323-
| **[`downgrade/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/downgrade/converge.yml)** | Downgrade to a specific version of NGINX |
324-
| **[`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 |
325-
| **[`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 |
326-
| **[`source/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/source/converge.yml)** | Install NGINX from source |
327-
| **[`stable/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/stable/converge.yml)** | Install NGINX using the latest stable release |
328-
| **[`uninstall/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/uninstall/converge.yml)** | Uninstall NGINX |
329-
| **[`uninstall-plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/uninstall-plus/converge.yml)** | Uninstall NGINX Plus |
330-
| **[`upgrade/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/upgrade/converge.yml)** | Upgrade NGINX |
331-
| **[`upgrade-plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/upgrade-plus/converge.yml)** | Upgrade NGINX Plus |
332-
| **[`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 |
321+
| **[`agent/converge.yml`](/molecule/agent/converge.yml)** | Install and configure NGINX Agent to connect to the NGINX One SaaS control plane on F5 Distributed Cloud |
322+
| **[`amplify/converge.yml`](/molecule/amplify/converge.yml)** | Install and configure the NGINX Amplify agent |
323+
| **[`default/converge.yml`](/molecule/default/converge.yml)** | Install a specific version of NGINX, install various NGINX supported modules, tweak systemd and set up logrotate |
324+
| **[`distribution/converge.yml`](/molecule/distribution/converge.yml)** | Install NGINX from the distribution's package repository instead of NGINX's package repository |
325+
| **[`downgrade/converge.yml`](/molecule/downgrade/converge.yml)** | Downgrade to a specific version of NGINX |
326+
| **[`downgrade-plus/converge.yml`](/molecule/downgrade-plus/converge.yml)** | Downgrade to a specific version of NGINX Plus |
327+
| **[`plus/converge.yml`](/molecule/plus/converge.yml)** | Install NGINX Plus and various NGINX Plus supported modules |
328+
| **[`source/converge.yml`](/molecule/source/converge.yml)** | Install NGINX from source |
329+
| **[`stable/converge.yml`](/molecule/stable/converge.yml)** | Install NGINX using the latest stable release |
330+
| **[`uninstall/converge.yml`](/molecule/uninstall/converge.yml)** | Uninstall NGINX |
331+
| **[`uninstall-plus/converge.yml`](/molecule/uninstall-plus/converge.yml)** | Uninstall NGINX Plus |
332+
| **[`upgrade/converge.yml`](/molecule/upgrade/converge.yml)** | Upgrade NGINX |
333+
| **[`upgrade-plus/converge.yml`](/molecule/upgrade-plus/converge.yml)** | Upgrade NGINX Plus |
334+
| **[`version/converge.yml`](/molecule/version/converge.yml)** | Install a specific version of NGINX and various NGINX modules |
333335

334336
> [!NOTE]
335337
> If you install this repository via Ansible Galaxy, you will need to replace the `include_role` variable in the example playbooks from `ansible-role-nginx` to `nginxinc.nginx`.
@@ -346,7 +348,7 @@ You can find the Ansible NGINX Unit role to install NGINX Unit [here](https://gi
346348

347349
## License
348350

349-
[Apache License, Version 2.0](https://github.com/nginxinc/ansible-role-nginx/blob/main/LICENSE)
351+
[Apache License, Version 2.0](/LICENSE)
350352

351353
## Author Information
352354

tasks/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: Validate distribution and role variables
2+
- name: Validate Ansible/Jinja2 version, role variables, and supported distributions
33
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate/validate.yml"
44
tags: nginx_validate
55

0 commit comments

Comments
 (0)