X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=playbooks%2Fdebian%2Froles%2Finstall-dehydrated%2Ftasks%2Fmain.yml;h=d43ef8a946d8cd26dd619124dd3fc0eee10140b5;hb=47138ce7977f2b88a41866ccd988fd0eed311df4;hp=16e0854dc3b4d63812f2ed45f66b715fba96cb59;hpb=4359bb87040b0c557aa6d74602c0ff9774bbc5a7;p=ansible.git diff --git a/playbooks/debian/roles/install-dehydrated/tasks/main.yml b/playbooks/debian/roles/install-dehydrated/tasks/main.yml index 16e0854..d43ef8a 100644 --- a/playbooks/debian/roles/install-dehydrated/tasks/main.yml +++ b/playbooks/debian/roles/install-dehydrated/tasks/main.yml @@ -1,8 +1,8 @@ - name: Test if dehydrated is already cloned - local_action: command test -f /usr/local/src/LetsEncrypt/dehydrated/.git/config - failed_when: false - register: dehydrated_exist - changed_when: dehydrated_exist.rc != 0 + local_action: + module: stat + path: /usr/local/src/LetsEncrypt/dehydrated/.git/config + register: dehydrated - name: Install git local_action: @@ -14,21 +14,21 @@ purge: yes state: latest update_cache: yes - when: dehydrated_exist.rc != 0 + when: not dehydrated.stat.exists - name: Prepare to clone dehydrated local_action: module: file path: /usr/local/src/LetsEncrypt state: directory - when: dehydrated_exist.rc != 0 + when: not dehydrated.stat.exists - name: Clone dehydrated local_action: module: git repo: https://github.com/lukas2511/dehydrated.git - dest: /usr/local/src/LetsEncrypt - when: dehydrated_exist.rc != 0 + dest: /usr/local/src/LetsEncrypt/dehydrated + when: not dehydrated.stat.exists - name: Prepare the server to syncronize dehydrated become: true @@ -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'