# Questions about roles\_path

**URL:** <https://forum.ansible.com/t/questions-about-roles-path/22803>\
**Category:** Ansible Project\
**Created:** [October 17, 2016, 8:27am UTC](https://forum.ansible.com/t/questions-about-roles-path/22803 "2016-10-17T08:27:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Candler](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Brian\_Candler](https://forum.ansible.com/u/Brian_Candler)\
**Post date:** [October 17, 2016, 8:27am UTC](https://forum.ansible.com/t/questions-about-roles-path/22803/1 "2016-10-17T08:27:05Z")

</div>

A couple of questions:

(1) Is it possible to set roles\_path within a playbook?

(I tried “vars: {roles\_path: …}” and “vars: {ansible\_roles\_path: …}” but they didn’t work)

(2) Is it possible to set roles\_path to search for directories relative to playbook\_dir ?

Here’s the use case. I want to organise a bundle playbooks into a set of sibling directories, plus a “shared” directory for roles common to them all.

foo/  
bar/  
baz/  
shared/

I would like to avoid writing

roles:

- …/shared/roles/xxx
- …/shared/roles/yyy

when referring to the shared roles. But I would also like users to be able to checkout the whole bundle at any location in the filesystem.

Thanks,

Brian.

---

<div class="post-metadata">

**Author:** ![Brian\_Candler](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Brian\_Candler](https://forum.ansible.com/u/Brian_Candler)\
**Post date:** [October 18, 2016, 7:39am UTC](https://forum.ansible.com/t/questions-about-roles-path/22803/2 "2016-10-18T07:39:51Z")

</div>

I think I found a workaround.

ansible looks for ansible.cfg in the current working directory, before looking in ~/.ansible.cfg or /etc/ansible.cfg

So I can include within the playbook directory:

[defaults]  
inventory = ./hosts  
roles\_path = …/shared/roles

This works as long as the user does:

cd path/to/playbook  
ansible-playbook playbook.yml

rather than:

ansible-playbook path/to/playbook/playbook.yml

(However I’d still like to be able to set roles\_path within a playbook, this would be a cleaner solution)

Regards,

Brian.
