summaryrefslogtreecommitdiff
path: root/roles/nginx/vhost/tasks/main.yml
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2023-08-09 14:38:23 +0200
committerChristian Pointner <equinox@spreadspace.org>2023-08-20 22:12:03 +0200
commitbc98352d3e331003db625be96139b3c1f95f63b2 (patch)
tree6f05ce12309fb46aaa9c9eee692573b49b692e4d /roles/nginx/vhost/tasks/main.yml
parentprepare test setups for new acme/cert roles (diff)
nginx/vhost: major change in certifcate/tls handling (WIP)
Diffstat (limited to 'roles/nginx/vhost/tasks/main.yml')
-rw-r--r--roles/nginx/vhost/tasks/main.yml21
1 files changed, 11 insertions, 10 deletions
diff --git a/roles/nginx/vhost/tasks/main.yml b/roles/nginx/vhost/tasks/main.yml
index 424c86a0..c5e68732 100644
--- a/roles/nginx/vhost/tasks/main.yml
+++ b/roles/nginx/vhost/tasks/main.yml
@@ -1,11 +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
+ when: "'tls' in nginx_vhost"
+ include_role:
+ name: "x509/{{ nginx_vhost.tls.certificate_provider }}/cert/prepare"
+ public: true
vars:
- acmetool_cert_name: "{{ nginx_vhost.name }}"
- acmetool_cert_hostnames: "{{ nginx_vhost.hostnames }}"
+ x509_certificate_name: "{{ nginx_vhost.name }}"
+ x509_certificate_hostnames: "{{ nginx_vhost.hostnames }}"
- name: install nginx configs from template
when: "'template' in nginx_vhost"
@@ -31,14 +32,14 @@
notify: reload nginx
- name: generate acme certificate
- when: "'acme' in nginx_vhost and nginx_vhost.acme"
+ when: "'tls' in nginx_vhost"
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
+ include_role:
+ name: "x509/{{ nginx_vhost.tls.certificate_provider }}/cert/finalize"
vars:
- acmetool_cert_name: "{{ nginx_vhost.name }}"
- acmetool_cert_hostnames: "{{ nginx_vhost.hostnames }}"
+ x509_certificate_name: "{{ nginx_vhost.name }}"
+ x509_certificate_hostnames: "{{ nginx_vhost.hostnames }}"