Installing collections from Git

543 views
Skip to first unread message

Wei-Yen Tan

unread,
May 18, 2021, 1:14:39 PM5/18/21
to AWX Project
I am trying to use a requirements file to install a collection from my own git repository.

In the documentation it says that I need to have something like this:

collections:
      type: git
      version: devel

So I have mine looking like this 

  collections: 
        type: git
        version: devel


This didnt work. I thought it may be that it can't get a collection artifact which I then added a release for. and changed the version number to v01-alpha as that has a tar.gz attached.

My version of ansible is core 2.12.0.dev0. I am using it within an execution environment in AWX.

Any help would be appreciated. 

Many thanks.


phil.gr...@gmail.com

unread,
May 19, 2021, 6:12:27 AM5/19/21
to AWX Project
You haven't said what error you're getting but looking at your repo, the only branch with anything in it is 'develop'

It's also not a valid collection:
Starting galaxy collection install process
Process install dependency map
ERROR! git+https://github.com/weiyentan/ansible.dbatools.collection.git,develop appears to be an SCM collection source, but the required galaxy.yml was not found. Append #path/to/collection/ to your URI (before the comma separated version, if one is specified) to point to a directory containing the galaxy.yml or directories of collections


Wei-Yen Tan

unread,
May 19, 2021, 6:18:54 AM5/19/21
to phil.gr...@gmail.com, AWX Project
Thank you Phil for replying. Sorry I should have said develop branch. In the root directory of develop branch I have ansible.yml there. Is it not formatted correctly? I apologise if I got it wrong. It's my first time writing a collection...and consuming it from repository. 


From: awx-p...@googlegroups.com <awx-p...@googlegroups.com> on behalf of phil.gr...@gmail.com <phil.gr...@gmail.com>
Sent: Wednesday, May 19, 2021 10:12:27 PM
To: AWX Project <awx-p...@googlegroups.com>
Subject: [awx-project] Re: Installing collections from Git
 
--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/b869cd65-9691-4889-800e-f700e3004de7n%40googlegroups.com.

Phil Griffiths

unread,
May 19, 2021, 6:24:18 AM5/19/21
to Wei-Yen Tan, AWX Project
You need a galaxy.yml metadata file for a collection, see this guide - https://docs.ansible.com/ansible/latest/dev_guide/developing_collections.html

Wei-Yen Tan

unread,
May 20, 2021, 3:37:52 AM5/20/21
to Phil Griffiths, AWX Project
Thanks Phil. I had to reread a few times what I put in the repo. Galaxy.yml. Not ansible.yml. Mind says one thing. Fingers does another :rollseyes:


From: Phil Griffiths <phil.gr...@gmail.com>
Sent: Wednesday, May 19, 2021 10:23:40 PM
To: Wei-Yen Tan <weiye...@gmail.com>
Cc: AWX Project <awx-p...@googlegroups.com>
Subject: Re: [awx-project] Re: Installing collections from Git
 
Reply all
Reply to author
Forward
0 new messages