aboutsummaryrefslogtreecommitdiffstats
path: root/roles/acme/tasks
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2021-01-24 14:43:28 +0100
committerbinary <me@rgoncalves.se>2021-01-24 14:43:28 +0100
commitb0d50d141c33cb84bef5742599c23d6f5fbc4ecc (patch)
treedc5d81d626afbb309d6c6c70f5252d002d838d57 /roles/acme/tasks
parent7e4d06eb95e4e3acbffe8d129aec2704ed5a661a (diff)
downloadinfrastructure-b0d50d141c33cb84bef5742599c23d6f5fbc4ecc.tar.gz
Add generation for subdomain in inventory
Diffstat (limited to 'roles/acme/tasks')
-rw-r--r--roles/acme/tasks/main.yml10
1 files changed, 8 insertions, 2 deletions
diff --git a/roles/acme/tasks/main.yml b/roles/acme/tasks/main.yml
index 4d0f67f..ff644a4 100644
--- a/roles/acme/tasks/main.yml
+++ b/roles/acme/tasks/main.yml
@@ -18,8 +18,13 @@
group: "{{ group_root }}"
mode: 0644
+- name: retrieve enabled domains
+ shell: grep "^domain" /etc/acme-client.conf | cut -d " " -f 2
+ register: subdomains
+
- name: generate acme certificates
- shell: acme-client -v {{ global.domain_name }}
+ shell: acme-client -v {{ item }}
+ loop: "{{ subdomains.stdout_lines }}"
register: result
failed_when: result.rc not in [ 0, 2 ]
@@ -32,4 +37,5 @@
name: "automatic acme certificates update"
minute: "0"
hour: "6,18"
- job: "acme-client -v {{ global.domain_name }}"
+ job: "acme-client -v {{ item }}"
+ loop: "{{ subdomains.stdout_lines }}"
remember that computers suck.