I am trying to write a file to my local machine with a dynamic inventory. I am running the following script in Ansible Tower:
---
- hosts: all
tasks:
- name: Copy the file
connection: local
run_once: true
copy: content="Hello, World!" dest=/tmp/hello.txt
This works when I run it without the connection: local (it ends up on the first matching host), but with connection: local the file does not appear, even though Ansible Tower shows that there was something changed. I have tried delegate_to: 127.0.0.1 and local_action: and in none of these cases do I find the file in /tmp.
Am I doing something wrong or is this a problem with Ansible?
Ansible version 2.0.1.0, Ansible Tower version 2.4.4.