From: Oleg Broytman Date: Sat, 27 Jul 2019 10:46:21 +0000 (+0300) Subject: Feat(dehydrated): Create a universal weekly runner X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=3969daf3a2f4c5c2cf5f9badbaee33eddbacd7dd;p=ansible.git Feat(dehydrated): Create a universal weekly runner --- diff --git a/playbooks/debian/roles/add-apache-vhost/tasks/dehydrated.yml b/playbooks/debian/roles/add-apache-vhost/tasks/dehydrated.yml index d1c38d8..4775e65 100644 --- a/playbooks/debian/roles/add-apache-vhost/tasks/dehydrated.yml +++ b/playbooks/debian/roles/add-apache-vhost/tasks/dehydrated.yml @@ -27,13 +27,3 @@ 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 index 9d9551a..0000000 --- a/playbooks/debian/roles/add-apache-vhost/templates/dehydrated +++ /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 index 0000000..35767c1 --- /dev/null +++ b/playbooks/debian/roles/install-dehydrated/files/dehydrated @@ -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 diff --git a/playbooks/debian/roles/install-dehydrated/tasks/main.yml b/playbooks/debian/roles/install-dehydrated/tasks/main.yml index 16e0854..dbd994c 100644 --- a/playbooks/debian/roles/install-dehydrated/tasks/main.yml +++ b/playbooks/debian/roles/install-dehydrated/tasks/main.yml @@ -43,3 +43,12 @@ 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'