All - I’m learning about Galaxy NG and evaluating for an air-gapped environment. I attempted to upload an internally-authored collection which contains dependencies in this form: git+https://github.com/ansible-collections/community.general.git
. The reason is that we’ve already set up mirroring from the upstream (GitHub-hosted) collections. In other words - path of least resistance for starters… Anyway on attempting to import the collection, the UI errors with: Invalid collection metadata. Invalid dependency format: 'git+https://github.com/ansible-collections/community.general.git'
. This is a valid dependency URL and in fact from the command line: ansible-galaxy collection install git+git@our.gitserver.org:our-project/our_collection_that_refs_ansible_community.git
works, so it just appears that the galaxy_importer
has not yet been made to accept this format. (Unless I’m mis-interpreting the error.) Is this in the radar? Thank you.
It might be more helpful if you paste your actual galaxy file, or at least the part thats relevant.
This seems to be working for me:
namespace: test
name: col
version: 1.0.0
readme: README.md
authors: []
description: Collection
license_file: LICENSE
tags: []
repository: ''
dependencies:
'git+https://github.com/ansible-collections/community.general.git': main
Sure - here is the contents of dependencies
:
dependencies:
'git+https://github.com/ansible-collections/community.general.git': '8.5.0'
'git+https://github.com/ansible-collections/community.crypto.git': '2.18.0'
'git+https://github.com/ansible-collections/ansible.posix.git': '1.5.4'
'git+https://github.com/ansible-collections/kubernetes.core.git': '3.0.1'
btw if relevant:
Server version
4.11.0dev
master:878b436e
Tried replacing explicit version numbers with main - same result
tried removing all but one dependency - same result
Replaced dependencies with:
dependencies: {}
And it succeeded in loading but then failed with:
roles/<redacted>/tasks/main.yaml:34:11: syntax-check[unknown-module]: couldn't resolve module/action 'kubernetes.core.k8s'. This often indicates a misspelling, missing collection, or incorrect module path.
(repeats for many roles in the collection)
interesting…
Just to add some info, I’m deploying Galaxy via the operator following the quick start here:
I’m deploying into an actual k8s cluster, not Minikube. I tried following the process from tag 2024.5.8
in case it was a regression in the main
branch but same. So I think at this time, the capability is not implemented. Fairly easy to reproduce based on the quick start:
git clone https://github.com/ansible/galaxy-operator
kubectl apply -k galaxy-operator
kubectl create -f galaxy-operator/galaxy-cr.yaml
(except in my case, to use the ingress in an actual cluster, create the CR this way):
sed 's/hostname: localhost/hostname: hostname.myco.org/'\
galaxy-cr.yaml | kubectl -n galaxy apply -f -
Then access Galaxy via the ingress: