Become directives vs connection variables

6 views
Skip to first unread message

aaldi

unread,
Oct 19, 2018, 3:40:26 PM10/19/18
to Ansible Project
I'm trying to understand privilege escalation, but have a hard time comparing these two concepts.

If I specify `become: yes`, does that mean that privilege escalation works now? What about if I specify `ansible_become: yes`? Do I have to have them both? or one?

Additionally, why does directives not have a password field, but the connection variables have ansible_become_pass?

aaldi

unread,
Oct 19, 2018, 3:45:01 PM10/19/18
to Ansible Project
I would appreciate help especially for using become on windows targets.

Brian Coca

unread,
Oct 19, 2018, 3:55:45 PM10/19/18
to Ansible Project
The directives are 'general' they work for all hosts so 'become' turns
it on for all hosts that don't specify otherwise.

The variables are 'specific' normally assigned to hosts that deviate
from the norm, so `ansible_become` is a variable and will override the
keyword for the host(s) that has this variable set.


You can also use configuration file, environment variables and CLI
optoins, but they all have less precedence than the keywords and
variables.


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