FreeKB - Ansible Understanding Ansible Library (modules directories)
Ansible - Understanding Ansible Library (modules directories)

Library contains the directories that will be searched for modules. If Ansible was installed on a Red Hat system using pip, library should contain the following directories.

/home/john.doe/.ansible/plugins/modules
/usr/share/ansible/plugins/modules
/usr/local/lib/python3.6/site-packages/ansible/modules

 

You can temporarily append directories to library using the ANSIBLE_LIBRARY environment variable. In this example, the /tmp directory is appended.

export ANSIBLE_LIBRARY=/home/joh.doe/.ansible/plugins/modules:/usr/share/ansible/plugins/modules:/usr/local/lib/python3.6/site-packages/ansible/modules:/tmp

 

And then you can echo the ANSIBLE_LIBRARY environment variable to confirm that the /tmp directory was appended.

~]# echo $ANSIBLE_LIBRARY
/home/john.doe/.ansible/plugins/modules:/usr/share/ansible/plugins/modules:/usr/local/lib/python3.6/site-packages/ansible/modules:/tmp

 

You can permanently append one or more library directory in the main ansible.cfg file.

library = /usr/local/ansible/collections/ansible_collections/ansible/posix

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter a4da8 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |