-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Oliver O'Mahony <[email protected]> Co-authored-by: Chris Adams <[email protected]>
- Loading branch information
1 parent
83e9fdb
commit dc4c714
Showing
32 changed files
with
439 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
# Install NGINX Agent. | ||
# Requires access to either the NGINX stub_status or the NGINX Plus REST API. | ||
nginx_agent_enable: false | ||
|
||
# Specify the NGINX Agent data plane key/token. | ||
# This is required to authenticate the NGINX Agent with the NGINX One SaaS control plane available in F5 Distributed Cloud. | ||
# Default is null. | ||
nginx_agent_data_plane_key: null | ||
|
||
# Specify the control plane server host and port. | ||
# Default is the NGINX One SaaS control plane available in F5 Distributed Cloud. | ||
nginx_agent_server_host: agent.connect.nginx.com | ||
nginx_agent_server_port: 443 | ||
|
||
# Enable TLS communication between data plane and control plane | ||
# Default is true. | ||
nginx_agent_tls_enable: true | ||
nginx_agent_tls_skip_verify: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
# Install NGINX Amplify. | ||
# Use your NGINX Amplify API key. | ||
# Requires access to either the NGINX stub_status or the NGINX Plus REST API. | ||
# Use your NGINX Amplify API key. | ||
# Default is null. | ||
nginx_amplify_enable: false | ||
nginx_amplify_api_key: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
- name: Cleanup | ||
hosts: localhost | ||
gather_facts: false | ||
tasks: | ||
- name: Cleanup NGINX Agent instances | ||
block: | ||
- name: Wait for containers to be up | ||
ansible.builtin.wait_for_connection: | ||
delay: 1 | ||
timeout: 2 | ||
ignore_errors: true | ||
register: container | ||
|
||
- name: Containers are not up, quit from here | ||
ansible.builtin.fail: | ||
when: container['failed'] | bool | ||
|
||
- name: Gather facts | ||
ansible.builtin.setup: | ||
gather_subset: | ||
- "!all" | ||
- "!any" | ||
- distribution | ||
|
||
- name: Get list of NGINX One dangling instance IDs | ||
ansible.builtin.uri: | ||
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 | ||
method: GET | ||
headers: | ||
Authorization: APIToken {{ lookup('env', 'ONE_API_TOKEN') }} | ||
register: get_ids | ||
|
||
- name: Remove dangling instances from NGINX One | ||
ansible.builtin.uri: | ||
url: https://{{ lookup('env', 'ONE_TENANT') }}.console.ves.volterra.io/api/nginx/one/namespaces/default/instances/{{ item }} | ||
method: DELETE | ||
status_code: 204 | ||
headers: | ||
Authorization: APIToken {{ lookup('env', 'ONE_API_TOKEN') }} | ||
loop: "{{ get_ids['json']['items'] | map(attribute='object_id') | list }}" | ||
rescue: | ||
- name: It's ok we're at startup | ||
ansible.builtin.meta: noop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: Install NGINX Agent | ||
ansible.builtin.include_role: | ||
name: ansible-role-nginx | ||
vars: | ||
nginx_agent_enable: true | ||
nginx_agent_data_plane_key: "{{ lookup('env', 'AGENT_DATA_PLANE_KEY') }}" |
Oops, something went wrong.