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"
[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