I have an ansible script and am trying to get the file name of a new item in a directory. I am using this Ansible script:
- name: Finding newest file in a folder find: paths: "/var/www/html/wwwroot/somefolder/" age: "latest" age_stamp: mtime
However, I get the following error:
FAILED! => {"age": "latest", "changed": false, "failed": true, "msg": "failed to process age"}
How can I get Ansible to get the file name with the newest file in the directory?
source share