Hello,

I am testing a dead simple playbook intended to verify that privilege 
escalation works. The code is at https://github.com/cscal/testplay

The error that Ansible gives me is:
FAILED! => {"changed": false, "msg": "Error, could not touch target: [Errno 
13] Permission denied: b'/root/test'", "path": "/root/test"}

As the ansible user on the control node I can SSH to 
[email protected], and run sudo commands successfully 
(including touching the test file in /root). Ansible tasks that don't need 
privilege escalation execute successfully. 

This executes successfully:
ansible all -m ping -u ansible --become --become-user ansible

The commands I've tried to run the playbook are every permutation of:
ansible-playbook -vvv site.yml --become --become-user=ansible -k
with and without -k, with and without "become" and "become_user".
The debug output shows that it is connecting over SSH to the expected 
"ansible" user.

At a loss, I tried editing /etc/ansible/ansible.conf like so:
sudo_user  = ansible
become_user=ansible
But this did not help.

I do not have any custom host variables or anything of that nature.

This is baffling to me. Any ideas to resolve this?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/531f67ed-f124-4afc-ba18-397993775fe8n%40googlegroups.com.

Reply via email to