X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=playbooks%2Fdebian%2Froles%2Fdehydrated%2Ftasks%2Fmain.yml;h=d6d7ed815ac28cc8cefe2263bf4e0571718cfbef;hb=1f0098f4393c8a923c1aa239be0ab80947d71385;hp=d43ef8a946d8cd26dd619124dd3fc0eee10140b5;hpb=49d5c6480b024b830d2cdb42fa9f70254f7bdb2a;p=ansible.git diff --git a/playbooks/debian/roles/dehydrated/tasks/main.yml b/playbooks/debian/roles/dehydrated/tasks/main.yml index d43ef8a..d6d7ed8 100644 --- a/playbooks/debian/roles/dehydrated/tasks/main.yml +++ b/playbooks/debian/roles/dehydrated/tasks/main.yml @@ -3,34 +3,35 @@ module: stat path: /usr/local/src/LetsEncrypt/dehydrated/.git/config register: dehydrated + changed_when: not dehydrated.stat.exists -- name: Install git - local_action: - module: apt - autoclean: yes - autoremove: yes - install_recommends: no - name: git - purge: yes - state: latest - update_cache: yes - when: not dehydrated.stat.exists +- block: + - name: Install git + become: true + local_action: + module: apt + autoclean: yes + autoremove: yes + cache_valid_time: 3600 + install_recommends: no + name: git + state: latest + update_cache: yes -- name: Prepare to clone dehydrated - local_action: - module: file - path: /usr/local/src/LetsEncrypt - state: directory - when: not dehydrated.stat.exists + - name: Prepare to clone dehydrated + local_action: + module: file + path: /usr/local/src/LetsEncrypt + state: directory -- name: Clone dehydrated - local_action: - module: git - repo: https://github.com/lukas2511/dehydrated.git - dest: /usr/local/src/LetsEncrypt/dehydrated + - name: Clone dehydrated + local_action: + module: git + repo: https://github.com/lukas2511/dehydrated.git + dest: /usr/local/src/LetsEncrypt/dehydrated when: not dehydrated.stat.exists -- name: Prepare the server to syncronize dehydrated +- name: Prepare the server to synchronize dehydrated become: true file: path: /usr/local/src/LetsEncrypt @@ -39,7 +40,7 @@ group: staff mode: "ug+rwx,o+rx,g+s" -- name: Syncronize dehydrated to the server +- name: Synchronize dehydrated to the server synchronize: src: /usr/local/src/LetsEncrypt/dehydrated dest: /usr/local/src/LetsEncrypt