]> git.phdru.name Git - ansible.git/blobdiff - playbooks/debian/roles/install-dehydrated/tasks/main.yml
Feat: Use module `stat` instead of command `test`
[ansible.git] / playbooks / debian / roles / install-dehydrated / tasks / main.yml
index dbd994c6c617627ef17e6dac40dce6e3d0863f50..7672bc86c05be347305e4db09d28f6bca6a21d3a 100644 (file)
@@ -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:
     purge: yes
     state: latest
     update_cache: yes
-  when: dehydrated_exist.rc != 0
+  when: 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: 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
+  when: dehydrated.stat.exists
 
 - name: Prepare the server to syncronize dehydrated
   become: true