Trouble integrating custom module_utils module

Hello!

I tried to write a custom module_utils module, I set up everything according to the docs, but for some reason I get an error:

Skipping plugin (…) as it seems to be invalid: No module named …

I’ve isolated the problem in a small project:
https://github.com/AndreiPashkin/ansible-test

To reproduce the issue it’s enough to have Ansible installed and then execute “run.sh”

Can someone please look into it?

We do not currently support importing custom module_utils from anything other than a module. As such, no other custom plugin types can import from a custom module_utils.

See https://github.com/ansible/ansible/issues/28770

That makes it clear, thanks a lot!

If someone having the same problem - I’ve found a workaround. I just use imp.find_module()/imp.load_module()functions from the standard library to load the module with shared code into a plugin module.