With this playbook (bug.yml):
- hosts: dev
user: soa
tasks:- name: create a file
command: /bin/touch /tmp/file
If I run:
ansible-playbook bug.yml
The resulting file looks like this:
ls -l /tmp/file
-rw-r–r–. 1 soa soa 0 Jul 25 09:21 /tmp/file
But if I run it with -K:
ansible-playbook -K bug.yml
I get:
ls -l /tmp/file
-rw-r–r–. 1 root root 0 Jul 25 09:23 /tmp/file
You can see that this command was really run as root.
This is a big problem that I originally discovered while trying to use the git command.
When ansible forces git to run as root, github does not know who the user is and ansible hangs.
Is this a bug?