I’m attempting to use the file module to delete some cruft left over after installing Wordpress and I’m getting a not found warning when the task executes. Not sure what I’m doing wrong…
On the target host, the path and files exist:
$ ls /var/www/wordpress
$ backwpup_30357501_measurabl-plugins.2017-09-03.txt backwpup_30357501_wordpress.sql license.txt …
Task:
- name: Ensure old backup files do not exist
file:
path: “{{ item }}”
state: absent
with_fileglob: - /var/www/wordpress/backwpup_*
Output when running task:
TASK [measurabl-wordpress : Ensure old backup files do not exist] **************
[WARNING]: Unable to find ‘/var/www/wordpress’ in expected paths.