Ansible - module_utils

By default, module_utils in ansible.cfg is commented out, like this.

#module_utils = /usr/share/my_module_utils/


Typically, the module_utils directory exists in the base Ansible directory (the same directory that contains ansible.cfg), like this.



However, I observed that this directory did not exist when installing Ansible using PIP. Instead, the module_utils directory was below the "ansible python module location" directory which can be seen using the ansible --version command.

~]# ansible --version
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible


In this scenario, it probably makes sense to update ansible.cfg to point to the module_utils directory, like this.

module_utils = /usr/local/lib/python3.6/site-packages/ansible/module_utils/


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


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