When I try to import a custom python module into another module, it no longer works in Tower 3.5. This exact setup works in 2.7.1, the current version of Ansible is 2.7.10.
My custom modules used in playbooks are in the library directory and the modules I import are in the main directory. So for example:
| My Repo
|
| example.py
|
| library/
| main.py
I have read that setting the ANSIBLE_LIBRARY env variable would tell ansible where to find the module. I tried setting this ANSIBLE_LIBRARY: "./", also "{{ playbook_dir }}" but that did not help. This this project is synced from a repo, I don't have a constant path to the custom modules...
Within main.py, if I try to import example, I used to be able to do this:
#!/usr/bin/python
from ansible.module_utils.basic import *
import example
This is the error message: ImportError: No module named example
Additional info, here is a workaround I came up with (MOD_PATH is '{{playbook_dir}}'):
sys.path.insert(0, yaml_data['MOD_PATH'])
import example