publishing custom modules, and module dependencies in roles

Hi,

I’m trying to figure out if I can publish a custom module, and roles that depend on it. The developing modules docs talk about setting ANSIBLE_LIBRARY environment variable for pointing to where a module exists, and ansible.cfg’s library can set a path, and then there’s the ./library folder within a playbook. But all of those controls are at the playbook level, not at the role level.

I can’t figure out how to indicate that a role depends on a particular custom module, and next, how to publish that role in a way that brings the custom module with it to e.g. Ansible Galaxy. I see that roles can express dependencies on other roles – which would be great, I could write a “wrapper” role around the module so it could function as a role dependency – but I’d have to first get the module to ship with the role.

Is there any way to ship a module along with a role? Or short of that, some way to declare a remote module dependency within a role? Or am I stuck with requiring every playbook that uses a role with a custom module dependency to micromanage the paths to those libraries?

best,
Charlie

Create a library dir inside the role, put modules there

This works now for all kind of plugins, callback_plugins/, filter_plugins/, etc