Ansible: Check If File Exists - ShellHacks
www.shellhacks.com › ansible-check-if-file-existsNov 07, 2021 · Posted on November 7, 2021 by admin. To check whether the destination file exists and then run tasks based on its status, we can use the Ansible’s stat module (or win_stat for Windows targets). With this module we can identify not only whether the destination path exists or not but also if it is a regular file, a directory or a symbolic link. Cool Tip: Enable DEBUG mode and increase VERBOSITY in Ansible!