Ansible running Galera arbitrator "run" command as root although "become: yes" is not used

Hi,

I have the following arbitrator_run role in Ansible :

  • name: Run garb
    service:
    name: garb
    state: started

The role in question is called from the main playbook as follows:

  • name: Run arbitrator
    hosts: galera_arbitrator
    roles:
  • { role: arbitrator_run}

As you can see, I am not using “become: yes” and yet Ansible tries to execute “service garb start” with escalated privileges.

How do I know it’s trying to run it with escalated privileges? It throws the same error when I run it manually after a “sudo su -”. The same command succeeds though when I manually run it without “sudo su -”.

However, there are some “become: yes” arguments in previous instructions (before “Run arbitrator”) but my understanding is each “become: yes” will be local to the bloc where it belongs.

Any assistance would be appreciated.

Thanks,
Hicham

Hi Hicham!

You can try to run your playbook with *-vvvv* to see verbose messages, or you can export ANSIBLE_DEBUG=1 to see what is going on underneath.
But… first of all - I would recommend to you to check your ansible.cfg (http://docs.ansible.com/ansible/latest/intro_configuration.html#become)

Best,
Karol