In my real playbook, I need to add new user myuser , then install home-brew for that user.
This is my command line to run below.
uadmin is the only user initially configured on machine given to me.
When I run below it install homebrew for uadmin and not as mach5-one
If I run each part of my real playbook from command line as uadmin to install user, then as myuser for everything else
it install homebrew as myuser… But that defeats the one play to install all parts and defining who to run things as.
I must be missing something real simple… if I add become: yes then I get permission issues
Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chown: /tmp/ansible-tmp-1521827588.02-202609912949198/: Operation not permitted
chown: /tmp/ansible-tmp-1521827588.02-202609912949198/stat.py: Operation not permitted
Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chown: /tmp/ansible-tmp-1521827588.02-202609912949198/: Operation not permitted
chown: /tmp/ansible-tmp-1521827588.02-202609912949198/stat.py: Operation not permitted
The only way I see to get it to work is to allow_world_readable_tmpfiles in the ansible.cfg
This seems like a messy solution… Returns the follow warning.
[WARNING]: Using world-readable permissions for temporary files Ansible needs to create when becoming an unprivileged user. This may be insecure. For information on securing this, see
Seems Kind of a hack solution… If I broke up the add user into 1 playbook. then ran using uadmin to add user, then the rest of the playbook in another and run
as myuser then all is well. But the defeats the become_user defines in the code.