I've tracked down what was causing this, and opened a bug on it.

https://github.com/ansible/ansible/issues/9813




On Dec 14, 2014, at 4:26 PM, Roy Smith wrote:

> I'm running ansible 1.8.2.  My local machine is running OSX 10.7.5.  The 
> remote machine I'm trying to manage is running Ubuntu 14.04.
> 
> I have one host in my inventory file.  My playbook is:
> 
> ---
> - hosts: all
>   remote_user: roy
>   tasks:
>   - name: create users
>     sudo: yes
>     user: name=hyc comment="Harlem Yacht Club" shell=/bin/bash
> 
> If I ssh to the Ununtu box as user roy (with ssh key authentication) and do 
> "sudo -s", it works fine; I get prompted for my password and after I type it, 
> I have a root shell.  But, ansible says:
> 
> $ ansible-playbook -i inventory --ask-sudo-pass playbook.yml 
> sudo password: 
> 
> 
> PLAY [all] 
> ******************************************************************** 
> 
> 
> GATHERING FACTS 
> *************************************************************** 
> ok: [dev.hyc.org]
> 
> 
> TASK: [create users] 
> ********************************************************** 
> failed: [dev.hyc.org] => {"failed": true, "parsed": false}
> 
> 
> roy is not in the sudoers file.  This incident will be reported.
> 
> 
> 
> 
> FATAL: all hosts have already failed -- aborting
> 
> 
> PLAY RECAP 
> ******************************************************************** 
>            to retry, use: --limit @/Users/roy/playbook.retry
> 
> 
> dev.hyc.org                : ok=1    changed=0    unreachable=0    failed=1
> 
> What's going on that sudo works on the command line but not via ansible?
> 
> 
> 
> -- 
> 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/ad5ef0ab-9ffd-4a70-a5e5-3555b1d79fc0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
Roy Smith
[email protected]



-- 
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/DD2B5C0F-1828-49A6-A163-006CC9BB3C02%40panix.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to