stuck on "Missing become password"

663 views
Skip to first unread message

Dave Thacker

unread,
Nov 24, 2015, 6:34:03 PM11/24/15
to Ansible Project
Hello
I'm trying to run a playbook that will login as user ansible and then sudo to root to make configurations.   I have a sudo entry that will allow root without password.   The playbook looks like this:

---
- hosts: 10.53.153.32
  remote_user: ansible
  become: yes
  become_user: root

  tasks:

  - name: create zabbix group
    action: group name=zabbix gid=1400

  - name: create zabbix user
    action: user name=zabbix uid=1400 group=zabbix comment="Zabbix Monitoring User" home="/u01/home/zabbix"

My output is gets this:
[ansible@devansible01 playbooks]$ ansible-playbook dave_test.yml

PLAY [10.53.153.32] ***********************************************************

GATHERING FACTS ***************************************************************
fatal: [10.53.153.32] => Missing become password

TASK: [create zabbix group] ***************************************************
FATAL: no hosts matched or all hosts have already failed -- aborting


PLAY RECAP ********************************************************************
           to retry, use: --limit @/home/ansible/dave_test.retry

10.53.153.32               : ok=0    changed=0    unreachable=1    failed=0

I can connect to target vm and correctly sudo.   Could someone please point out my error?

Thanks!     Dave


Rob Wilkerson

unread,
Nov 24, 2015, 7:36:23 PM11/24/15
to Ansible Project
Try replacing become_user: root with:

become_method: sudo

That may work better.

Brian Coca

unread,
Nov 24, 2015, 7:53:56 PM11/24/15
to Ansible Project
become_user defaults to root, no need to specify, same with become_method: sudo

can you run with -vvvv and show the output? also what ansible version?
OSs involved?


--
Brian Coca

Dave Thacker

unread,
Nov 25, 2015, 9:32:25 AM11/25/15
to Ansible Project
Thanks for your help,  The OS is Oracle Linux 6.7.   This is a run with -vvvv and the identical playbook.

 [ansible@devansible01 playbooks]$ ansible-playbook -vvvv dave_test.yml

PLAY [10.53.153.32] ***********************************************************

GATHERING FACTS ***************************************************************
<10.53.153.32> ESTABLISH CONNECTION FOR USER: ansible
<10.53.153.32> REMOTE_MODULE setup
<10.53.153.32> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/ansible/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 10.53.153.32 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1448461765.18-146079134487044 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1448461765.18-146079134487044 && echo $HOME/.ansible/tmp/ansible-tmp-1448461765.18-146079134487044'
<10.53.153.32> PUT /tmp/tmp6GajGq TO /home/ansible/.ansible/tmp/ansible-tmp-1448461765.18-146079134487044/setup
<10.53.153.32> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/ansible/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 10.53.153.32 /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=tegibnqlmaxkmlsnfbhesmbwdtrirnci] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-tegibnqlmaxkmlsnfbhesmbwdtrirnci; LANG=C LC_CTYPE=C /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1448461765.18-146079134487044/setup; rm -rf /home/ansible/.ansible/tmp/ansible-tmp-1448461765.18-146079134487044/ >/dev/null 2>&1'"'"''
fatal: [10.53.153.32] => Missing become password

TASK: [create zabbix group] ***************************************************
FATAL: no hosts matched or all hosts have already failed -- aborting


PLAY RECAP ********************************************************************
           to retry, use: --limit @/home/ansible/dave_test.retry

10.53.153.32               : ok=0    changed=0    unreachable=1    failed=0

Thanks!  Dave



--
Brian Coca

Dave Thacker

unread,
Nov 25, 2015, 9:42:01 AM11/25/15
to Ansible Project


On Tuesday, November 24, 2015 at 6:53:56 PM UTC-6, Brian Coca wrote:
Sorry,  omiited the ansible version.  We're running 1.9.2

DT
 

--
Brian Coca
Reply all
Reply to author
Forward
0 new messages