From b0d50d141c33cb84bef5742599c23d6f5fbc4ecc Mon Sep 17 00:00:00 2001 From: binary Date: Sun, 24 Jan 2021 14:43:28 +0100 Subject: Add generation for subdomain in inventory --- roles/acme/templates/acme-client.conf.j2 | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'roles/acme/templates') diff --git a/roles/acme/templates/acme-client.conf.j2 b/roles/acme/templates/acme-client.conf.j2 index 3ff6971..0b9ea6c 100644 --- a/roles/acme/templates/acme-client.conf.j2 +++ b/roles/acme/templates/acme-client.conf.j2 @@ -14,3 +14,15 @@ domain {{ global.domain_name }} { domain full chain certificate "/etc/ssl/{{ global.domain_name }}.fullchain.pem" sign with letsencrypt } + +{% for h in groups["servers"] %} +{% set h = dict(hostvars[h]) %} +{% for service in h.services if service.domain is defined %} +domain {{ service.domain }}.{{ global.domain_name }} { + domain key "/etc/ssl/private/{{ service.domain }}.{{ global.domain_name }}.key" + domain certificate "/etc/ssl/{{ service.domain }}.{{ global.domain_name }}.crt" + domain full chain certificate "/etc/ssl/{{ service.domain }}.{{ global.domain_name }}.fullchain.pem" + sign with letsencrypt +} +{% endfor %} +{% endfor %} -- cgit v1.2.3