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?