diff options
| author | Kumar Damani <me@kumardamani.net> | 2025-06-30 21:11:10 +0000 |
|---|---|---|
| committer | Kumar Damani <me@kumardamani.net> | 2025-06-30 21:11:10 +0000 |
| commit | a125ec65a120ce23e4e692a48eaa169bc40e5506 (patch) | |
| tree | c1c7ed19c1e00f33d5fe6d7caa3c622945b3c423 /ansible/roles/caddy_add | |
| parent | 7e603bcc92c7ddc19dbfb0c46434bc6847ad3781 (diff) | |
ansible refactor to newer methods
Diffstat (limited to 'ansible/roles/caddy_add')
| -rw-r--r-- | ansible/roles/caddy_add/meta/argument_specs.yaml | 26 | ||||
| -rw-r--r-- | ansible/roles/caddy_add/meta/main.yaml | 3 | ||||
| -rw-r--r-- | ansible/roles/caddy_add/tasks/main.yaml | 9 |
3 files changed, 29 insertions, 9 deletions
diff --git a/ansible/roles/caddy_add/meta/argument_specs.yaml b/ansible/roles/caddy_add/meta/argument_specs.yaml new file mode 100644 index 0000000..3c40bd6 --- /dev/null +++ b/ansible/roles/caddy_add/meta/argument_specs.yaml @@ -0,0 +1,26 @@ +--- + +argument_specs: + main: + short_description: Main entry point for the Caddy add role + description: + - This role updates our Caddy RProxy via it's API with a new route. + author: + - Kumar Damani + options: + caddy_add_hosts: + type: 'list' + elements: 'str' + required: true + description: + - The desired fqdn for the service to add. + caddy_add_upstream_host: + type: 'str' + required: true + description: + - The hostname of the host hosting this service. + caddy_add_upstream_port: + type: 'int' + required: true + description: + - The port of the service on the host. diff --git a/ansible/roles/caddy_add/meta/main.yaml b/ansible/roles/caddy_add/meta/main.yaml new file mode 100644 index 0000000..0f50759 --- /dev/null +++ b/ansible/roles/caddy_add/meta/main.yaml @@ -0,0 +1,3 @@ +--- + +dependencies: [] diff --git a/ansible/roles/caddy_add/tasks/main.yaml b/ansible/roles/caddy_add/tasks/main.yaml index 4dcbd8a..8177f6a 100644 --- a/ansible/roles/caddy_add/tasks/main.yaml +++ b/ansible/roles/caddy_add/tasks/main.yaml @@ -1,14 +1,5 @@ --- -- name: 'Ensure required vars are set' - ansible.builtin.assert: - that: - - item | mandatory - loop: - - '{{ caddy_add_hosts }}' - - '{{ caddy_add_upstream_host }}' - - '{{ caddy_add_upstream_port }}' - - name: 'Call the Caddy API to add our new host' ansible.builtin.uri: url: 'http://rproxy:2019/config/apps/http/servers/srv0/routes/0' |
