diff options
author | Christian Pointner <equinox@spreadspace.org> | 2023-08-08 00:42:56 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2023-08-20 22:12:03 +0200 |
commit | 5b08c3fb96e54e0ae8ae1d650658b27dcdfd78de (patch) | |
tree | 48ef1e0e6ef766a63f1b04a071a4ebfd0b90c323 /roles/nginx/vhost/tasks/main.yml | |
parent | fix docker for debian bookworm+ (diff) |
make acmetool cert role more generic (WIP - needs more testing)
Diffstat (limited to 'roles/nginx/vhost/tasks/main.yml')
-rw-r--r-- | roles/nginx/vhost/tasks/main.yml | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/roles/nginx/vhost/tasks/main.yml b/roles/nginx/vhost/tasks/main.yml index 1b5e3392..424c86a0 100644 --- a/roles/nginx/vhost/tasks/main.yml +++ b/roles/nginx/vhost/tasks/main.yml @@ -1,4 +1,12 @@ --- +- name: ensure certificate exists (fake it, until you make it) + when: "'acme' in nginx_vhost and nginx_vhost.acme" + import_role: + name: x509/acmetool/cert/prepare + vars: + acmetool_cert_name: "{{ nginx_vhost.name }}" + acmetool_cert_hostnames: "{{ nginx_vhost.hostnames }}" + - name: install nginx configs from template when: "'template' in nginx_vhost" template: @@ -24,4 +32,13 @@ - name: generate acme certificate when: "'acme' in nginx_vhost and nginx_vhost.acme" - include_tasks: acme.yml + block: + - name: make sure nginx config has been (re)loaded + meta: flush_handlers + + - name: actually request the certificate + import_role: + name: x509/acmetool/cert/finalize + vars: + acmetool_cert_name: "{{ nginx_vhost.name }}" + acmetool_cert_hostnames: "{{ nginx_vhost.hostnames }}" |