I have created a log file using ansible an have named the log file with the host name. I need to fetch that file from all my hosts and put it in a directory on the control server. However, it runs fine but does not copy the files over. Here is my cmds.
name: “Find needsreboot.log file”
find:
paths: /dir/
patterns: “*.needsreboot.log” I have also tried $HOSTNAME-needsreboot.log
-name:
fetch: src: /dir/*.needsreboot.log
dest: /dir on control server/logs
flat: yes
I’m pretty new to Ansible and I am doing something wrong when I try it with variables. All I get is errors now. and I have not even gotten to the loop part yet.