Hello all,

I have the exact same problem.  In a brand new directory, with new 
ansible.cfg file and hosts file the following playbook fails when I ask the 
password to do sudo, but only with the file module, the command module 
works just fine.
---
- name: yaml de test de fail.
  hosts: acceptation
  gather_facts: False
  tasks:
    
    - name: test script general
      command: id
      register: uid
      become: yes
      become_user: wso2
#    - debug: var=uid
    - debug: msg="{{uid.stdout}}"
 
    - name: copy file tmp
      copy: src=files/blabla.txt dest=/tmp/blabla.txt
      become: yes
      become_user: wso2

Here is the output :

[*Ananke::* 13:09] [Ansible/wso2/TestFails] > ansible-playbook fail.yml 
--ask-sudo-pass

SUDO password: 


PLAY [yaml de test de fail.] 
************************************************** 


TASK: [test script general] 
*************************************************** 

changed: [acceptation]


TASK: [debug msg="{{uid.stdout}}"] 
******************************************** 

ok: [acceptation] => {

    "msg": "uid=500(wso2) gid=500(wso2) groups=500(wso2) 
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023"

}


TASK: [copy file tmp] 
********************************************************* 

fatal: [acceptation] => ssh connection closed waiting for a privilege 
escalation password prompt


FATAL: all hosts have already failed -- aborting


PLAY RECAP 
******************************************************************** 

           to retry, use: --limit @/Users/simonpie/fail.retry


acceptation                : ok=2    changed=1    unreachable=1    
failed=0   


[*Ananke::* 13:10] [Ansible/wso2/TestFails] > 

Whilst everything works perfectly if I add the NOPASSWD to the sodoer file 
fo the user I use to log into the machine.

Here is the ansible.cfg file :

[*Ananke::* 13:10] [Ansible/wso2/TestFails] > more ansible.cfg 

[defaults]

hostfile = hosts

private_key_file = ~/.ssh/id_rsa

library = /Users/ME/Documents/Ansible/wso2/.library


[*Ananke::* 13:15] [Ansible/wso2/TestFails] > 
the hosts file :

[*Ananke::* 13:15] [Ansible/wso2/TestFails] > more hosts 

[loc]

local ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222 
ansible_ssh_user=vagrant 
ansible_ssh_private_key_file=/Users/ME/Documents/Ansible/wso2/.vagrant/machines/default/virtualbox/private_key
 
cutename=vmwso2



[dev]

lab ansible_ssh_host=IP ansible_ssh_user=devME 
ansible_ssh_private_key_file=~/.ssh/id_rsa cutename=labwso2


[accept]

acceptation ansible_ssh_host=otherIP ansible_ssh_user=accME 
ansible_ssh_private_key_file=~/.ssh/id_rsa cutename=accwso2


[*Ananke::* 13:16] [Ansible/wso2/TestFails] > 

I have check that all the files mentioned in the ansible-playbook manual 
pages do not exist.  Any idea what could go wrong here ?

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f72e7818-3372-4902-9202-290762efb9b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to