diff --git a/roles/vault/tasks/shared/sync_file.yml b/roles/vault/tasks/shared/sync_file.yml index ebc46939d..b56602eb5 100644 --- a/roles/vault/tasks/shared/sync_file.yml +++ b/roles/vault/tasks/shared/sync_file.yml @@ -37,8 +37,9 @@ loop_control: loop_var: host_item when: - - hostvars[host_item]["sync_file_stat"]["stat"]["exists"]|bool - host_item in play_hosts + - hostvars[host_item]["sync_file_stat"]["stat"] is defined + - hostvars[host_item]["sync_file_stat"]["stat"]["exists"]|bool - name: "sync_file | Combine all possible key file sync sources" set_fact: