diff --git a/roles/vault/tasks/shared/sync_file.yml b/roles/vault/tasks/shared/sync_file.yml index 4ea63be90..ebc46939d 100644 --- a/roles/vault/tasks/shared/sync_file.yml +++ b/roles/vault/tasks/shared/sync_file.yml @@ -30,30 +30,15 @@ register: sync_file_key_stat when: sync_file_is_cert|d() -- name: "DEBUG VAULT : hostvar" - debug: - msg: "{{ hostvars }}" - -- name: debug - debug: - var: sync_file_hosts | unique - -- name: moar debug - set_fact: - sync_file_srcs: "{{ sync_file_srcs|default([]) + [host_item] }}" - debug: - msg: "{{ hostvars[host_item]['sync_file_stat'] }}" - with_items: "{{ sync_file_hosts | unique }}" - loop_control: - loop_var: host_item - - name: "sync_file | Combine all possible file sync sources" set_fact: sync_file_srcs: "{{ sync_file_srcs|default([]) + [host_item] }}" with_items: "{{ sync_file_hosts | unique }}" loop_control: loop_var: host_item - when: hostvars[host_item]["sync_file_stat"]["stat"]["exists"]|bool + when: + - hostvars[host_item]["sync_file_stat"]["stat"]["exists"]|bool + - host_item in play_hosts - name: "sync_file | Combine all possible key file sync sources" set_fact: