How do you use External Ansible Modules
I have been using an ansible module developed for vmware VcloudDirector. It is a great module and really helps speed up and maintain consistency when provisioning - over a human user.
So I created the playbooks within the directory and tested it out like that.
But now it is ready I just want to keep the relevant stuff in the library and import the module for where I am running the scripts.
The information to do that is in the ansible docs - adding a module locally
Check that you have access to a module
ansible-module-vcloud-director repo has a number of modules under the
To check if you module is available use:
ansible-doc -t module vcd_org
If it is found you will get the documentation. If it does not exist you get a warning:
[WARNING]: module vcd_org not found in: /Users/xxx...
Adding the module Locally
To add the module locally you need to add it to one of these places
- any directory added to the
ANSIBLE_LIBRARYenvironment variable (
$ANSIBLE_LIBRARYtakes a colon-separated list like
You can also add a
ansible.cfg to your directory (or in the
~/.ansible.cfg directory) and then you can set the default module path:
[defaults] library = ./<my-module-folder>
You can also put the modules in your project folder (like you would when running on something like AWX) and then put an
ansible.cfg into that folder specifying the module name:
[defaults] library = modules module_utils = module_utils