knowledge/technology/tools/Ansible/tests/ansible.builtin.exists.md
2023-12-04 11:02:23 +01:00

9 lines
No EOL
298 B
Markdown

# ansible.builtin.exists
Check if the provided path maps to an existing filesystem object on the controller (localhost).
## Examples
```yml
vars:
my_etc_hosts_exists: "{{ '/etc/hosts' is exist }}"
list_of_local_files_to_copy_to_remote: "{{ list_of_all_possible_files | select('exists') }}"
```