# Behavior change related to roles\_path config with relative include

**URL:** <https://forum.ansible.com/t/behavior-change-related-to-roles-path-config-with-relative-include/22272>\
**Category:** Ansible Project\
**Created:** [August 11, 2016, 10:25am UTC](https://forum.ansible.com/t/behavior-change-related-to-roles-path-config-with-relative-include/22272 "2016-08-11T10:25:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien\_Tognazzi](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@Julien\_Tognazzi](https://forum.ansible.com/u/Julien_Tognazzi)\
**Post date:** [August 11, 2016, 10:25am UTC](https://forum.ansible.com/t/behavior-change-related-to-roles-path-config-with-relative-include/22272/1 "2016-08-11T10:25:14Z")

</div>

Hi list,

I upgraded ansible with the latest epel-testing version ansible-2.1.1.0-1.el7.noarch and noticed a change with the roles\_path configuration.

This is my roles\_path:

`  
roles\_path = /etc/ansible/roles:…/base/roles:./roles

`

So I expect that if I run a playbook from /vagrant/ansible/somedir it will look for roles in /vagrant/ansible/base/roles and /vagrant/ansible/somedir/roles

But it doesn’t seem to be the case anymore.

With

`ansible 2.1.1.0 config file = /etc/ansible/ansible.cfg configured module search path = ['/usr/local/share/ansible_modules/']`

If running a play referencing non existant role, I have  
`  
$ pwd  
/vagrant/ansible/somedir  
$ansible-playbook test.yml -v

Using /etc/ansible/ansible.cfg as config file  
ERROR! the role ‘somerole’ was not found in /vagrant/ansible/somedir/roles:/vagrant/ansible/somedir:/etc/ansible/roles:/etc/base/roles:/etc/ansible/roles

`

With  
`  
ansible 2.1.0.0  
config file = /etc/ansible/ansible.cfg  
configured module search path = [‘/usr/local/share/ansible\_modules/’]

`

Running the same play gives me:  
`  
$ pwd  
/vagrant/ansible/somedir  
$ansible-playbook test.yml -v

[WARNING]: provided hosts list is empty, only localhost is available

ERROR! the role ‘somerole’ was not found in /vagrant/ansible/somedir/roles:/vagrant/ansible/somedir:/etc/ansible/roles:…/base/roles:./roles

`

The behavior change is highlighted in yellow above.

Is this a regression ?

thanks for your explanation

---

<div class="post-metadata">

**Author:** ![Julien\_Tognazzi](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@Julien\_Tognazzi](https://forum.ansible.com/u/Julien_Tognazzi)\
**Post date:** [September 2, 2016, 7:51am UTC](https://forum.ansible.com/t/behavior-change-related-to-roles-path-config-with-relative-include/22272/2 "2016-09-02T07:51:07Z")

</div>

I think I’ve found what changed between 2.1.0.0 and 2.1.1.0.

it seems to be related to this pull request [#16088](https://github.com/ansible/ansible/pull/16088)  
precisely the change on file lib/ansible/constants.py

So now the path configured in ansible.cfg roles\_path are relative to where the ansible.cfg file is !  
Before, it was relative to the execution directory.

This change breaks some of my playbooks.  
Do I have to modified my layout or can this be considered as a regression and fixed ??

thanks you for reading.

Julien.

---

<div class="post-metadata">

**Author:** ![Julien\_Tognazzi](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@Julien\_Tognazzi](https://forum.ansible.com/u/Julien_Tognazzi)\
**Post date:** [September 2, 2016, 7:53am UTC](https://forum.ansible.com/t/behavior-change-related-to-roles-path-config-with-relative-include/22272/3 "2016-09-02T07:53:47Z")

</div>

There is already an open issue about this see [#16747](https://github.com/ansible/ansible/issues/16747)

---

<div class="post-metadata">

**Author:** ![Tobias\_Wolf](https://avatars.discourse-cdn.com/v4/letter/t/eada6e/32.png) [@Tobias\_Wolf](https://forum.ansible.com/u/Tobias_Wolf)\
**Post date:** [September 2, 2016, 9:26am UTC](https://forum.ansible.com/t/behavior-change-related-to-roles-path-config-with-relative-include/22272/4 "2016-09-02T09:26:31Z")

</div>

Same problem here.

$ echo $ANSIBLE\_CONFIG  
./users/tobias.wolf/ansible.cfg

$ grep role users/tobias.wolf/ansible.cfg  
roles\_path = ./roles

ERROR! the role ‘actions/common-handlers’ was not found in … /home/towolf/src/ansible/users/tobias.wolf/roles
