# Become directives vs connection variables

**URL:** <https://forum.ansible.com/t/become-directives-vs-connection-variables/28831>\
**Category:** Ansible Project\
**Created:** [October 19, 2018, 7:40pm UTC](https://forum.ansible.com/t/become-directives-vs-connection-variables/28831 "2018-10-19T19:40:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaldi](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@aaldi](https://forum.ansible.com/u/aaldi)\
**Post date:** [October 19, 2018, 7:40pm UTC](https://forum.ansible.com/t/become-directives-vs-connection-variables/28831/1 "2018-10-19T19:40:26Z")

</div>

I’m trying to understand[privilege escalation](https://docs.ansible.com/ansible/2.6/user_guide/become.html#command-line-options), 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?

---

<div class="post-metadata">

**Author:** ![aaldi](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@aaldi](https://forum.ansible.com/u/aaldi)\
**Post date:** [October 19, 2018, 7:45pm UTC](https://forum.ansible.com/t/become-directives-vs-connection-variables/28831/2 "2018-10-19T19:45:00Z")

</div>

I would appreciate help especially for using become on windows targets.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 19, 2018, 7:55pm UTC](https://forum.ansible.com/t/become-directives-vs-connection-variables/28831/3 "2018-10-19T19:55:03Z")

</div>

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.
