Copy local file if exists, using ansible
A more comprehensive answer: If you want to check the existence of a local file before performing some task, here is the comprehensive snippet: – name: get file stat to be able to perform a check in the following task local_action: stat path=/path/to/file register: file – name: copy file if it exists copy: src=/path/to/file dest=/destination/path when: … Read more