]> git.phdru.name Git - ansible.git/commitdiff
Feat(dehydrated): Create a universal weekly runner
authorOleg Broytman <phd@phdru.name>
Sat, 27 Jul 2019 10:46:21 +0000 (13:46 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 27 Jul 2019 10:46:21 +0000 (13:46 +0300)
playbooks/debian/roles/add-apache-vhost/tasks/dehydrated.yml
playbooks/debian/roles/add-apache-vhost/templates/dehydrated [deleted file]
playbooks/debian/roles/install-dehydrated/files/dehydrated [new file with mode: 0755]
playbooks/debian/roles/install-dehydrated/tasks/main.yml

index d1c38d8518bf249585a8fcbdaf5162b8e3265347..4775e65a6063370a2bedff8bfa609a00c26dfece 100644 (file)
     group: root
     mode: '0700'
     force: no
-
-- name: Configure dehydrated weekly run
-  become: true
-  template:
-    src: dehydrated
-    dest: /etc/cron.weekly
-    owner: root
-    group: root
-    mode: '0700'
-    force: no
diff --git a/playbooks/debian/roles/add-apache-vhost/templates/dehydrated b/playbooks/debian/roles/add-apache-vhost/templates/dehydrated
deleted file mode 100755 (executable)
index 9d9551a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-cd "`dirname \"$0\"`" &&
-exec /usr/local/apache2/.dehydrated/{{ virtual_host }}/dehydrated
diff --git a/playbooks/debian/roles/install-dehydrated/files/dehydrated b/playbooks/debian/roles/install-dehydrated/files/dehydrated
new file mode 100755 (executable)
index 0000000..35767c1
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+cd "`dirname \"$0\"`" &&
+for dehydrated in /usr/local/apache2/.dehydrated/*/dehydrated; do
+   if test "$dehydrated" = "/usr/local/apache2/.dehydrated/*/dehydrated"; then
+      exit
+   fi
+   $dehydrated
+done
index 16e0854dc3b4d63812f2ed45f66b715fba96cb59..dbd994c6c617627ef17e6dac40dce6e3d0863f50 100644 (file)
   synchronize:
     src: /usr/local/src/LetsEncrypt/dehydrated
     dest: /usr/local/src/LetsEncrypt
+
+- name: Configure dehydrated weekly run
+  become: true
+  copy:
+    src: dehydrated
+    dest: /etc/cron.weekly
+    owner: root
+    group: root
+    mode: '0700'