# Roles Path not read from ansible.cfg

**URL:** <https://forum.ansible.com/t/roles-path-not-read-from-ansible-cfg/21487>\
**Category:** Ansible Project\
**Created:** [May 19, 2016, 2:59am UTC](https://forum.ansible.com/t/roles-path-not-read-from-ansible-cfg/21487 "2016-05-19T02:59:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzarzoso](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@jzarzoso](https://forum.ansible.com/u/jzarzoso)\
**Post date:** [May 19, 2016, 2:59am UTC](https://forum.ansible.com/t/roles-path-not-read-from-ansible-cfg/21487/1 "2016-05-19T02:59:51Z")

</div>

I’m using vagrant and I have this structure

- controller

- roles

- ansible

- tasks

- main.yml

- inventories

- playbooks

- master.yml

- environment

- provisioning

- ansible.cfg

- vagrant.yml

- Vagrantfile

The `environment` directory is supposed to be where the vagrant machine runs. And the `controller` directory is where all my Ansible scripts are found.

Under my ansible.cfg I have these settings:

# environment/provisioning/ansible.cfg

[defaults]  
hostfile = ../../controller/inventories/development  
roles\_path = ../../controller/roles

# environment

However, when I try to run my Vagrant. It doesn’t seem to detect where the external roles path were. I used to have the roles inside my `provisioning` directory but decided to transfer it under the controller directory because it is also used in that directory where all my Ansible playbooks are.. I can ran using master.yml with the ansible role without problem.

2 things:

1. The error is `ERROR! the role 'ansible' was not found in /environment/provisioning/roles` Looks like it’s still looking for the default path without taking my ansible.cfg into consideration.
2. How do I print out the default configs in the terminal and debug the values if what I put in the ansible.cfg has been read correctly?

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 23, 2016, 9:13am UTC](https://forum.ansible.com/t/roles-path-not-read-from-ansible-cfg/21487/2 "2016-05-23T09:13:22Z")

</div>

> Under my ansible.cfg I have these settings:
> 
> # environment/provisioning/ansible.cfg  
> [defaults]  
> hostfile = ../../controller/inventories/development  
> roles\_path = ../../controller/roles

Have you tried setting an absolute path here?

Is the hostfile set according to what you specify here?

> 1. The error is `ERROR! the role 'ansible' was not found in  
> /environment/provisioning/roles` Looks like it's still looking for the  
> default path without taking my ansible.cfg into consideration.  
> 2. How do I print out the default configs in the terminal and debug the  
> values if what I put in the ansible.cfg has been read correctly?

ansible --version states some things.

Also running a playbook with 'ansible-playbook -v" states which  
configuration file is used.

I would guess it is maybe vagrant that messes these things up. Did you  
call ansible directly (just for testing)?

Johannes
