Behavior change related to roles_path config with relative include

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

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
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.

There is already an open issue about this see #16747

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