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.



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.



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 6a43e in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |