knowledge/technology/tools/Ansible/tests/ansible.builtin.exists.md

9 lines
298 B
Markdown
Raw Normal View History

2023-12-04 10:02:23 +00:00
# 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') }}"
```