Skip to content

Commit 0304bf0

Browse files
authored
Merge branch 'main' into bump-ansible-collections
2 parents f079adf + dc4c714 commit 0304bf0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+651
-176
lines changed

.github/workflows/f5-cla.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "F5 CLA Workflow"
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_target:
6+
types: [opened, closed, synchronize]
7+
8+
permissions:
9+
actions: write
10+
contents: write
11+
pull-requests: write
12+
statuses: write
13+
14+
jobs:
15+
f5-cla:
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- name: "F5 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/[email protected]
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
PERSONAL_ACCESS_TOKEN: ${{ secrets.F5_CLA_TOKEN }}
24+
with:
25+
path-to-signatures: 'signatures/beta/signatures.json'
26+
path-to-document: 'https://github.com/f5/.github/blob/main/CLA/cla-markdown.md'
27+
# Any pull request targeting the following branch will trigger a CLA check
28+
branch: 'main'
29+
custom-pr-sign-comment: 'I have hereby read the F5 CLA and agree to its terms'
30+
custom-notsigned-prcomment: '🎉 Thank you for your contribution. It appears you have not yet signed the F5 Contributor License Agreement, which is required for your changes to be incorporated into an F5 project. Please kindly read the [F5 CLA](https://github.com/f5/.github/blob/main/CLA/cla-markdown.md) and comment the following to agree:'
31+
custom-allsigned-prcomment: 'All required contributors have signed the F5 CLA for this PR ✅'
32+
remote-organization-name: 'f5'
33+
remote-repository-name: 'f5-cla-data'
34+
# Comma seperated list of usernames for maintainers or any other individuals who should not be prompted for a CLA.
35+
allowlist: oxpa, alessfg, bot*

.github/workflows/molecule.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,19 @@ jobs:
3939
runs-on: ubuntu-22.04
4040
needs: ansible-lint
4141
env:
42+
AGENT_DATA_PLANE_KEY: ${{ secrets.AGENT_DATA_PLANE_KEY }}
4243
AMPLIFY_API_KEY: ${{ secrets.AMPLIFY_API_KEY }}
4344
AMPLIFY_EMAIL: ${{ secrets.AMPLIFY_EMAIL }}
4445
AMPLIFY_PASSWORD: ${{ secrets.AMPLIFY_PASSWORD }}
4546
NGINX_CRT: ${{ secrets.NGINX_CRT }}
4647
NGINX_KEY: ${{ secrets.NGINX_KEY }}
48+
ONE_API_TOKEN: ${{ secrets.ONE_API_TOKEN }}
49+
ONE_TENANT: ${{ secrets.ONE_TENANT }}
4750
strategy:
4851
fail-fast: false
4952
matrix:
5053
scenario:
54+
- agent
5155
- amplify
5256
- default
5357
- distribution

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
name: Update release draft
1616
runs-on: ubuntu-22.04
1717
steps:
18-
- uses: release-drafter/release-drafter@v5
18+
- uses: release-drafter/release-drafter@v6
1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ansible-core==2.16.2
1+
ansible-core==2.16.5
22
jinja2==3.1.3
33
ansible-compat==4.1.11
4-
yamllint==1.33.0
5-
ansible-lint==6.22.2
4+
yamllint==1.35.1
5+
ansible-lint==24.2.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ansible-core==2.16.2
1+
ansible-core==2.16.5
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
ansible-core==2.16.2
1+
ansible-core==2.16.5
22
jinja2==3.1.3
33
ansible-compat==4.1.11
4-
molecule==6.0.3
5-
molecule-plugins[docker]==23.5.0
4+
molecule==24.2.0
5+
molecule-plugins[docker]==23.5.3
66
docker==7.0.0

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
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+
- Implement the ability to install the NGINX Agent.
8+
- Add Alpine Linux 3.19 to the list of NGINX Open Source and NGINX Plus tested and supported distributions.
9+
- Remove Alpine Linux 3.15 from the list of NGINX Open Source and NGINX Plus tested and supported distributions.
910

1011
ENHANCEMENTS:
1112

@@ -20,7 +21,9 @@ BUG FIXES:
2021
CI/CD:
2122

2223
- Add Molecule tests for NGINX Amplify.
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.
24+
- Update the RHEL based tests to use the latest UBI release.
25+
- 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.
26+
- Implement F5 CLA signatures.
2427

2528
## 0.24.2 (October 3rd, 2023)
2629

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Follow our [Installation Guide](https://github.com/nginxinc/ansible-role-nginx/b
2727

2828
### Project Structure
2929

30-
- The NGINX Ansible role is written in `yaml` and supports NGINX Open Source, NGINX Plus, and NGINX Amplify.
30+
- The NGINX Ansible role is written in `yaml` and supports NGINX Open Source, NGINX Plus, NGINX Agent and NGINX Amplify.
3131
- The project follows the standard [Ansible role directory structure](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html):
3232
- The main code is found in [`tasks/`](https://github.com/nginxinc/ansible-role-nginx/blob/main/tasks/).
3333
- Variables can be found in [`defaults/main/`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/).

README.md

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Ansible NGINX Role
1010

11-
This role installs NGINX Open Source, NGINX Plus, or the NGINX Amplify agent on your target host.
11+
This role installs NGINX Open Source, NGINX Plus, NGINX Agent or the NGINX Amplify agent on your target host.
1212

1313
**Note:** This role is still in active development. There may be unidentified issues and the role variables may change as development continues.
1414

@@ -85,7 +85,7 @@ git clone https://github.com/nginxinc/ansible-role-nginx.git
8585

8686
## Platforms
8787

88-
The NGINX Ansible role supports all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html), [NGINX Plus](https://docs.nginx.com/nginx/technical-specs/), and the [NGINX Amplify agent](https://github.com/nginxinc/nginx-amplify-doc/blob/master/amplify-faq.md#21-what-operating-systems-are-supported):
88+
The NGINX Ansible role supports almost all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html), [NGINX Plus](https://docs.nginx.com/nginx/technical-specs/), the [NGINX Agent](https://docs.nginx.com/nginx-agent/technical-specifications/), and the [NGINX Amplify agent](https://github.com/nginxinc/nginx-amplify-doc/blob/master/amplify-faq.md#21-what-operating-systems-are-supported):
8989

9090
### NGINX Open Source
9191

@@ -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:
@@ -166,6 +166,46 @@ Ubuntu:
166166
- jammy (22.04)
167167
```
168168

169+
### NGINX Agent
170+
171+
```yaml
172+
AlmaLinux:
173+
- 8
174+
- 9
175+
Alpine:
176+
- 3.16
177+
- 3.17
178+
- 3.18
179+
- 3.19
180+
Amazon Linux:
181+
- 2
182+
Debian:
183+
- bullseye (11)
184+
- bookwork (12)
185+
CentOS:
186+
- 7.4+
187+
FreeBSD:
188+
- 13
189+
- 14
190+
Oracle Linux:
191+
- 7.4+
192+
- 8
193+
- 9
194+
Red Hat:
195+
- 7
196+
- 8
197+
- 9
198+
Rocky Linux:
199+
- 8
200+
- 9
201+
SUSE/SLES:
202+
- 12
203+
- 15
204+
Ubuntu:
205+
- focal (20.04)
206+
- jammy (22.04)
207+
```
208+
169209
### NGINX Amplify Agent
170210

171211
```yaml
@@ -183,7 +223,7 @@ Ubuntu:
183223
- jammy (22.04)
184224
```
185225

186-
**Note:** You can also use this role to compile NGINX Open Source from source, install NGINX Open Source on compatible yet unsupported platforms, or install NGINX Open Source on BSD systems at your own risk.
226+
**Note:** At your own risk, you can also use this role to compile NGINX Open Source from source, install NGINX Open Source on "compatible" yet unsupported platforms, install NGINX from your respective distribution package manager, or install NGINX Open Source on BSD systems.
187227

188228
## Role Variables
189229

@@ -192,6 +232,7 @@ This role has multiple variables. The descriptions and defaults for all these va
192232
| Name | Description |
193233
| ---- | ----------- |
194234
| **[`main.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/main.yml)** | NGINX installation variables |
235+
| **[`agent.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/agent.yml)** | NGINX Agent installation variables |
195236
| **[`amplify.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/amplify.yml)** | NGINX Amplify agent installation variables |
196237
| **[`bsd.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/bsd.yml)** | BSD installation variables |
197238
| **[`logrotate.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/logrotate.yml)** | Logrotate configuration variables |
@@ -210,6 +251,7 @@ Working functional playbook examples can be found in the **[`molecule/`](https:/
210251

211252
| Name | Description |
212253
| ---- | ----------- |
254+
| **[`agent/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/agent/converge.yml)** | Install and configure the NGINX Agent to connect to the NGINX One SaaS control plane on F5 Distributed Cloud |
213255
| **[`amplify/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/amplify/converge.yml)** | Install and configure the NGINX Amplify agent |
214256
| **[`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 |
215257
| **[`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 |

defaults/main/agent.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
# Install NGINX Agent.
3+
# Requires access to either the NGINX stub_status or the NGINX Plus REST API.
4+
nginx_agent_enable: false
5+
6+
# Specify the NGINX Agent data plane key/token.
7+
# This is required to authenticate the NGINX Agent with the NGINX One SaaS control plane available in F5 Distributed Cloud.
8+
# Default is null.
9+
nginx_agent_data_plane_key: null
10+
11+
# Specify the control plane server host and port.
12+
# Default is the NGINX One SaaS control plane available in F5 Distributed Cloud.
13+
nginx_agent_server_host: agent.connect.nginx.com
14+
nginx_agent_server_port: 443
15+
16+
# Enable TLS communication between data plane and control plane
17+
# Default is true.
18+
nginx_agent_tls_enable: true
19+
nginx_agent_tls_skip_verify: false

defaults/main/amplify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# Install NGINX Amplify.
3-
# Use your NGINX Amplify API key.
43
# Requires access to either the NGINX stub_status or the NGINX Plus REST API.
4+
# Use your NGINX Amplify API key.
55
# Default is null.
66
nginx_amplify_enable: false
77
nginx_amplify_api_key: null

handlers/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@
4141
ansible.builtin.service:
4242
name: amplify-agent
4343
state: started
44+
enabled: true
45+
46+
- name: (Handler) Start NGINX Agent
47+
ansible.builtin.service:
48+
name: nginx-agent
49+
state: started
50+
enabled: true
4451

4552
- name: (Handler) Start logrotate
4653
ansible.builtin.command:

molecule/agent/cleanup.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
- name: Cleanup
3+
hosts: localhost
4+
gather_facts: false
5+
tasks:
6+
- name: Cleanup NGINX Agent instances
7+
block:
8+
- name: Wait for containers to be up
9+
ansible.builtin.wait_for_connection:
10+
delay: 1
11+
timeout: 2
12+
ignore_errors: true
13+
register: container
14+
15+
- name: Containers are not up, quit from here
16+
ansible.builtin.fail:
17+
when: container['failed'] | bool
18+
19+
- name: Gather facts
20+
ansible.builtin.setup:
21+
gather_subset:
22+
- "!all"
23+
- "!any"
24+
- distribution
25+
26+
- name: Get list of NGINX One dangling instance IDs
27+
ansible.builtin.uri:
28+
url: https://{{ lookup('env', 'ONE_TENANT') }}.console.ves.volterra.io/api/nginx/one/namespaces/default/instances?paginated=false&filter_fields=hostname&filter_ops=IN&filter_values=almalinux-8|almalinux-9|alpine-3.16|alpine-3.17|alpine-3.18|alpine-3.19|amazonlinux-2|centos-7|debian-bullseye|debian-bookworm|oraclelinux-7|oraclelinux-8|oraclelinux-9|rhel-7|rhel-8|rhel-9|rockylinux-8|rockylinux-9|sles-15|ubuntu-focal|ubuntu-jammy
29+
method: GET
30+
headers:
31+
Authorization: APIToken {{ lookup('env', 'ONE_API_TOKEN') }}
32+
register: get_ids
33+
34+
- name: Remove dangling instances from NGINX One
35+
ansible.builtin.uri:
36+
url: https://{{ lookup('env', 'ONE_TENANT') }}.console.ves.volterra.io/api/nginx/one/namespaces/default/instances/{{ item }}
37+
method: DELETE
38+
status_code: 204
39+
headers:
40+
Authorization: APIToken {{ lookup('env', 'ONE_API_TOKEN') }}
41+
loop: "{{ get_ids['json']['items'] | map(attribute='object_id') | list }}"
42+
rescue:
43+
- name: It's ok we're at startup
44+
ansible.builtin.meta: noop

molecule/agent/converge.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
tasks:
5+
- name: Install NGINX Agent
6+
ansible.builtin.include_role:
7+
name: ansible-role-nginx
8+
vars:
9+
nginx_agent_enable: true
10+
nginx_agent_data_plane_key: "{{ lookup('env', 'AGENT_DATA_PLANE_KEY') }}"

0 commit comments

Comments
 (0)