I'm fairly new to ansible, and am currently trying to have a play that reads a log file, register directories in that file, and then deletes the directories
Right now I can get the correct output, and register the path, however the delete portion is throwing me
name: Get the names of directories that need to be deleted shell: grep "Errno 21" /path/error.log | awk '{ print $7 }' | tr -d \' register: Errno21
debug: msg: "{{Errno21.stdout}}"
name: Remove Directories file: path={{Errno21.stdout}} state=absent
TASK [remove files] ******************************* ok:
But the "directories" are not deleted.
How can I tell ansible that these are directories? I was thinking " file_type: directory" but that failed. Is it the module?