# become\_flags for specific inventory host

**URL:** <https://forum.ansible.com/t/become-flags-for-specific-inventory-host/29582>\
**Category:** Ansible Project\
**Created:** [January 31, 2019, 5:56pm UTC](https://forum.ansible.com/t/become-flags-for-specific-inventory-host/29582 "2019-01-31T17:56:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruno\_Cochofel](https://avatars.discourse-cdn.com/v4/letter/b/4da419/32.png) [@Bruno\_Cochofel](https://forum.ansible.com/u/Bruno_Cochofel)\
**Post date:** [January 31, 2019, 5:56pm UTC](https://forum.ansible.com/t/become-flags-for-specific-inventory-host/29582/1 "2019-01-31T17:56:31Z")

</div>

Hi,

I have the need to configure become\_flags var for some of my inventory hosts (because of old sudo versions not accepting " -H -S -n").  
I was trying to do this on my dynamic inventory with hostvars for that host, but doesn’t work, I think become\_flags only works for plays and tasks.

Can I handle this in some other way?

Thanks,  
Bruno

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [January 31, 2019, 6:12pm UTC](https://forum.ansible.com/t/become-flags-for-specific-inventory-host/29582/2 "2019-01-31T18:12:58Z")

</div>

To place it in hostvars you need to name it `ansible_become_flags`:

[https://docs.ansible.com/ansible/latest/user\_guide/intro\_inventory.html#list-of-behavioral-inventory-parameters](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#list-of-behavioral-inventory-parameters)

---

<div class="post-metadata">

**Author:** ![Bruno\_Cochofel](https://avatars.discourse-cdn.com/v4/letter/b/4da419/32.png) [@Bruno\_Cochofel](https://forum.ansible.com/u/Bruno_Cochofel)\
**Post date:** [February 1, 2019, 12:09pm UTC](https://forum.ansible.com/t/become-flags-for-specific-inventory-host/29582/3 "2019-02-01T12:09:37Z")

</div>

Thanks Matt, that worked.
