Try replacing become_user: root with: become_method: sudo
That may work better. On Tuesday, November 24, 2015 at 6:34:03 PM UTC-5, Dave Thacker wrote: > > 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 > > > -- 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/80fc3ed5-5c94-4a57-929a-902eb2dd4c7b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
