where should I install my own collection plugin?

Hi all,

I want ton use an inventory file which needs a personnal plugin that I wrote.
I installed it in a the pre-existing folder /var/lib/awx/vendor/awx_ansible_collections/ansible_collections/ovirt/ovirt/plugins/inventory/ on awx_task container.
But this is ephemeral.

Is there a way to to make a “clean” and persist customized plugin installation over the container lifecycle? Maybe in an other place with a docker volume?
What would be your advices?

do you use anything for source code? if you add a collections folder you can place your collection in it, and it will sync to awx with the project. This way it follows your playbooks with every install

Thank you, it is a useful tip for standard templates, but I need to use a plugin that is not invocated by a dynamic inventory, that is to say:

ansible-inventory -i ovirt.yml --list
and ovirt.yml contains: plugin: ovirt.ovirt.ovirt
By default, awx is looking for the plugin in /var/lib/awx/vendor/awx_ansible_collections/ansible_collections/ovirt/ovirt/plugins/inventory/ which is proper to awx_task.
I’d like to install my own plugin in an other place that I can mount to the host as a docker volume.

Where can I tell to ansible-inventory to look for this plugin instead of the default above?

Hello,

I think you can do the same for dynamic inventories.
Just define your collection in collections/requirements.yml, create a project in AWX pointing to that git repository and in the inventory add a source → sourced from a project and use that project.

Good luck!

Thank you sergio, you are right, ansible-inventory works as well with a collections directory at the root level of the project. I believed that defining “collections_paths: ./collection” in a custom ansible.cfg at the same level was a mandatory, but it is not, collections directory is enough.
This is what I did so as to create dynamic inventory with my own plugin new_hosts.ovirt:

(ansible-galaxy collection init nbt.awx --init-path collections/ansible_collections ) → maybe optional?

mkdir -p collections/ansible_collections/nbt/awx/plugins/inventory && rsync -av new_hosts.ovirt.py collections/ansible_collections/nbt/awx/plugins/inventory/
touch new_hosts.ovirt.yml
echo “plugin: nbt.ovirt.new_hosts_ovirt” > new_hosts.ovirt.yml
git push

Finally, in AWX, I choose that project selecting the new_hosts.ovirt.yml playbook