# where should I install my own collection plugin?

**URL:** <https://forum.ansible.com/t/where-should-i-install-my-own-collection-plugin/34322>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [December 11, 2020, 9:14pm UTC](https://forum.ansible.com/t/where-should-i-install-my-own-collection-plugin/34322 "2020-12-11T21:14:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathanael\_Blanchet](https://avatars.discourse-cdn.com/v4/letter/n/dc4da7/32.png) [@Nathanael\_Blanchet](https://forum.ansible.com/u/Nathanael_Blanchet)\
**Post date:** [December 11, 2020, 9:14pm UTC](https://forum.ansible.com/t/where-should-i-install-my-own-collection-plugin/34322/1 "2020-12-11T21:14:52Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![wmedley](https://avatars.discourse-cdn.com/v4/letter/w/258eb7/32.png) [@wmedley](https://forum.ansible.com/u/wmedley)\
**Post date:** [December 12, 2020, 2:07am UTC](https://forum.ansible.com/t/where-should-i-install-my-own-collection-plugin/34322/2 "2020-12-12T02:07:08Z")

</div>

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

![]()

---

<div class="post-metadata">

**Author:** ![Nathanael\_Blanchet](https://avatars.discourse-cdn.com/v4/letter/n/dc4da7/32.png) [@Nathanael\_Blanchet](https://forum.ansible.com/u/Nathanael_Blanchet)\
**Post date:** [December 12, 2020, 9:40am UTC](https://forum.ansible.com/t/where-should-i-install-my-own-collection-plugin/34322/3 "2020-12-12T09:40:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sdmorel](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sdmorel](https://forum.ansible.com/u/sdmorel)\
**Post date:** [December 17, 2020, 1:37pm UTC](https://forum.ansible.com/t/where-should-i-install-my-own-collection-plugin/34322/4 "2020-12-17T13:37:16Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Nathanael\_Blanchet](https://avatars.discourse-cdn.com/v4/letter/n/dc4da7/32.png) [@Nathanael\_Blanchet](https://forum.ansible.com/u/Nathanael_Blanchet)\
**Post date:** [December 18, 2020, 10:49am UTC](https://forum.ansible.com/t/where-should-i-install-my-own-collection-plugin/34322/5 "2020-12-18T10:49:41Z")

</div>

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

…
