# "ansible\_group\_priority" option seems to be ignoring me

**URL:** <https://forum.ansible.com/t/ansible-group-priority-option-seems-to-be-ignoring-me/28447>\
**Category:** Ansible Project\
**Created:** [August 28, 2018, 4:10pm UTC](https://forum.ansible.com/t/ansible-group-priority-option-seems-to-be-ignoring-me/28447 "2018-08-28T16:10:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomas\_Nunez](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@Tomas\_Nunez](https://forum.ansible.com/u/Tomas_Nunez)\
**Post date:** [August 28, 2018, 4:10pm UTC](https://forum.ansible.com/t/ansible-group-priority-option-seems-to-be-ignoring-me/28447/1 "2018-08-28T16:10:44Z")

</div>

Hi  
I'm trying to change the order in which our group\_vars are loaded with ansible\_group\_priority but it's not working.

I have a role at roles/mytest/tasks/main.yaml like this:

---

<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:** [August 28, 2018, 5:53pm UTC](https://forum.ansible.com/t/ansible-group-priority-option-seems-to-be-ignoring-me/28447/2 "2018-08-28T17:53:06Z")

</div>

You cannot set group priority in group\_vars files as it handles the  
priority in which group\_vars files are read, you need to set it in the  
main inventory source.

---

<div class="post-metadata">

**Author:** ![Tomas\_Nunez](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@Tomas\_Nunez](https://forum.ansible.com/u/Tomas_Nunez)\
**Post date:** [August 29, 2018, 10:25am UTC](https://forum.ansible.com/t/ansible-group-priority-option-seems-to-be-ignoring-me/28447/3 "2018-08-29T10:25:23Z")

</div>

I tried, but it's not working either. ​I just made a mini-version of our inventory script, adding the ansible\_group\_priority:

---

<div class="post-metadata">

**Author:** ![Tomas\_Nunez](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@Tomas\_Nunez](https://forum.ansible.com/u/Tomas_Nunez)\
**Post date:** [August 29, 2018, 10:53am UTC](https://forum.ansible.com/t/ansible-group-priority-option-seems-to-be-ignoring-me/28447/4 "2018-08-29T10:53:25Z")

</div>

I found the problem, I wasn't putting the priority inside "vars". The inventory that works is this one:
