Ansible writing to a file

Hi all,

So I’m trying to write to a local file from my ansible server based off information I’ve gotten from my inventory hosts. For some reason, it keeps creating the file ON the inventory host instead of my ansible server. Here is my playbook:

looks like you have missed " delegate_to: localhost" in first task.

Thanks for the update, however, it looks like it’s not using the sudoer I’m wanting it to use. I have become: yes up top which I would think would run as the sudoer user I’m intending.

If I’m trying to run this playbook in my homedir which is where all my others are initiated from and added become: yes and knowing that the sudoer user is listed in my ansible.cfg file, it doesn’t seem to be running as that.

Have you included become_method: sudo ?