Ansible allows you to put modules in a location that is relative to the project you are working on.

To accomplish this, ensure that an ansible.cfg file exists in the directory that you run Ansible from.

Inside the ansible.cfg file, add the following code.

[defaults]library=./library

This code instructs Ansible to look for modules in a directory called library that is relative to where the ansible.cfg file exists.

You can take the modules in the f5-ansible repository and put them in that directory.

Note

Specifying a library directory does not override the system location where Ansible searches for modules. It only tells Ansible to “look here first” when importing a module.
Therefore, if a module in the specified library directory does not exist, Ansible will fall back to the system location and look for the module there.

You can also specify multiple locations by separating them with a colon. For example, if you have two different directories with two different sets of modules in them, you might do something like this:

[defaults]library=./library:./unstable

In this example, when looking for a module named foo.py, Ansible follows this order:

./library/foo.py

./unstable/foo.py

Recursively through /usr/local/lib/PYTHON_VERSION/site-packages/ansible/modules/