From 3969daf3a2f4c5c2cf5f9badbaee33eddbacd7dd Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 27 Jul 2019 13:46:21 +0300 Subject: [PATCH] Feat(dehydrated): Create a universal weekly runner --- .../debian/roles/add-apache-vhost/tasks/dehydrated.yml | 10 ---------- .../debian/roles/add-apache-vhost/templates/dehydrated | 3 --- .../debian/roles/install-dehydrated/files/dehydrated | 9 +++++++++ .../debian/roles/install-dehydrated/tasks/main.yml | 9 +++++++++ 4 files changed, 18 insertions(+), 13 deletions(-) delete mode 100755 playbooks/debian/roles/add-apache-vhost/templates/dehydrated create mode 100755 playbooks/debian/roles/install-dehydrated/files/dehydrated 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' -- 2.39.5