aboutsummaryrefslogtreecommitdiffstats
path: root/roles/acme
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2022-12-17 21:59:58 +0100
committerRomain Gonçalves <me@rgoncalves.se>2022-12-21 17:19:46 +0100
commit8ce56f15e0751870b56805010241dcfe8389b10f (patch)
tree5cb2c136ea8d829c93810d908e63501ff79afd6e /roles/acme
parent783cfa8469c7922f787305e15e95c0619479744b (diff)
downloadrules-8ce56f15e0751870b56805010241dcfe8389b10f.tar.gz
refactor: remove global __services from roles
Diffstat (limited to 'roles/acme')
-rw-r--r--roles/acme/defaults/main.yml2
-rw-r--r--roles/acme/templates/acme-client.conf.j26
2 files changed, 5 insertions, 3 deletions
diff --git a/roles/acme/defaults/main.yml b/roles/acme/defaults/main.yml
index 24201bd..66ca704 100644
--- a/roles/acme/defaults/main.yml
+++ b/roles/acme/defaults/main.yml
@@ -1,4 +1,6 @@
---
+acme_rules: {}
+
acme_configuration_file: /etc/acme-client.conf
acme_domain_name: null
diff --git a/roles/acme/templates/acme-client.conf.j2 b/roles/acme/templates/acme-client.conf.j2
index 3792009..583c3d5 100644
--- a/roles/acme/templates/acme-client.conf.j2
+++ b/roles/acme/templates/acme-client.conf.j2
@@ -14,9 +14,9 @@ domain {{ acme_domain_name }} {
}
{% call(h) macros.loop_valid_hosts("servers") -%}
-{% for service in h.__services if service.domain is defined %}
-domain {{ service.domain }}.{{ acme_domain_name }} {
- {% set domain = service.domain ~ "." ~ acme_domain_name %}
+{% for name, rules in h.acme_rules.items() if rules.domain is defined %}
+domain {{ rules.domain }}.{{ acme_domain_name }} {
+ {% set domain = rules.domain ~ "." ~ acme_domain_name %}
alternative names { www.{{ domain }} }
domain key "/etc/ssl/private/{{ domain }}.key"
domain full chain certificate "/etc/ssl/{{ domain }}.crt"
remember that computers suck.