Open msaladna opened 5 years ago
Seeing this same issue using ansible 2.8 and mitogen 0.2.8; in our case though we're running ansible/mitogen during an AWS user-data script, so it runs as root. The file task fails when we used become_user to switch to a local service account. In our case we can work around it since the become_user wasn't a necessary step for the execution, so we just removed it.
@dw this is actually becoming a pretty major error, it impacts multiple tasks in our playbooks, and we cannot roll back to 0.2.7 because it isn't compatible with ansible 2.8
Looks to be related to the fix from #591
I think I've just hit this as well ... is there a workaround?
My use case is this.. and I think I found a workaround for me:
- name: do something
become_user: "{{ lookup('env', 'USER') }}" # https://github.com/mitogen-hq/mitogen/issues/636
become: true
command:
chdir: /tmp
cmd: my_command
delegate_to: 127.0.0.1 # Run this locally (where you issued ansible from)
This runs local to where I issued the ansible command per delegate_to, so I just become the user who issues the ansible command as a workaround.
module_utils
loaded? Nofatal: [localhost]: FAILED! => { "msg": "Unexpected failure during module execution.", "stdout": "" }
ansible-config dump --only-changed
DEFAULT_STRATEGY(/usr/local/apnscp/resources/playbooks/ansible.cfg) = mitogen_linear DEFAULT_STRATEGY_PLUGIN_PATH(/usr/local/apnscp/resources/playbooks/ansible.cfg) = [u'/usr/lib/python2.7/site-packages/ansible_mitogen/plugins/strategy']
Verification of the permissions:
Then if we change permissions to allow access by user "postgres":
Likewise the play completes as expected: