Search code examples
linuxansibleansible-2.xansible-inventoryansible-galaxy

Ansible Galaxy roles incorrect path


When i install anything via ansible-galaxy like

ansible-galaxy install 1nfinitum.php

it is saved in

/root/.ansible/roles/1nfinitum.php

but the default path like mentioned in Galaxy is

 /etc/ansible/roles 

My ansible.cfg

 #inventory      = /etc/ansible/hosts
 #library        = /usr/share/my_modules/
 #module_utils   = /usr/share/my_module_utils/
 #remote_tmp     = ~/.ansible/tmp
 #local_tmp      = ~/.ansible/tmp

why roles are not getting stored in default path what am i doing wrong ?


Solution

  • Q: "Why roles are not getting stored in default path what am I doing wrong ?"

    A: Find out how the configuration was changed. Run the command

    shell> ansible-config dump --only-changed
    

    and search DEFAULT_ROLES_PATH. For example

    DEFAULT_ROLES_PATH(/home/admin/.ansible.cfg) = ['/home/admin/.ansible/roles']
    

    You'll find out who and how changed the default configuration.