sudo not working

171 views
Skip to first unread message

Roy Smith

unread,
Dec 14, 2014, 4:26:57 PM12/14/14
to ansible...@googlegroups.com
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?


Roy Smith

unread,
Dec 15, 2014, 8:19:10 AM12/15/14
to ansible...@googlegroups.com
I've tracked down what was causing this, and opened a bug on it.





--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
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



Michael DeHaan

unread,
Dec 15, 2014, 8:36:48 AM12/15/14
to ansible...@googlegroups.com
Replied on the ticket.

I'm sympathetic to the problem but we really do want this on by default.

I'm definitely open to creative solutions.



Reply all
Reply to author
Forward
0 new messages