ctucx.git: ansible-configs

My personal ansible roles and playbooks [deprecated in favor of nixos]

commit 56edbfe392892fc47da0993d9d04c7a4e84164f2
parent 0bae7fda9a2797564bd3468c1c87fb7c646c10cb
Author: Leah Thein <leah@toaster.fritz.box>
Date: Wed, 2 Dec 2020 00:19:49 +0100

acme-redirect: add some checks
1 file changed, 23 insertions(+), 3 deletions(-)
M
roles/acme-redirect/tasks/main.yml
|
26
+++++++++++++++++++++++---
diff --git a/roles/acme-redirect/tasks/main.yml b/roles/acme-redirect/tasks/main.yml
@@ -45,12 +45,32 @@
     validate: jq '.' %s
 
 - awall:
-   name: web
-   state: enabled
-   activate: yes
+    name: web
+    state: enabled
+    activate: yes
 
 - name: Enable and start acme-redirect
   service:
    name: acme-redirect
    enabled: yes
    state: restarted
+
+- command:
+    cmd: acme-redirect check -q
+  register: acme_check
+  become: yes
+  become_user: acme-redirect
+
+- fail:
+    msg: "Check of Certs failed: {{acme_check.stdout}}"
+  when: acme_check.stdout | length > 0
+
+- command:
+    cmd: acme-redirect renew -q
+  register: acme_renew
+  become: yes
+  become_user: acme-redirect
+
+- fail:
+    msg: "Renew of certs failed: {{acme_renew.stdout}}"
+  when: acme_renew.stdout | length > 0