# Ansible Collections - Handling a Dependent Collection that is only available via SCM

**URL:** <https://forum.ansible.com/t/ansible-collections-handling-a-dependent-collection-that-is-only-available-via-scm/44388>\
**Category:** Get Help\
**Tags:** dependencies, collections, galaxy-ng\
**Created:** [August 28, 2025, 7:00pm UTC](https://forum.ansible.com/t/ansible-collections-handling-a-dependent-collection-that-is-only-available-via-scm/44388 "2025-08-28T19:00:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbrennand](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dbrennand/32/7830_2.png) [@dbrennand](https://forum.ansible.com/u/dbrennand)\
**Post date:** [August 28, 2025, 7:00pm UTC](https://forum.ansible.com/t/ansible-collections-handling-a-dependent-collection-that-is-only-available-via-scm/44388/1 "2025-08-28T19:00:37Z")

</div>

Hi Ansible Community 🙂

In my collection I have a playbook which uses some modules from a different collection however, that collection is only published on GitHub and is not published on Ansible Galaxy.

How can I declare in my collection that this other dependent collection is required? AFAIK, in my collection’s [`galaxy.yml`](https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html#structure) file it only supports installing dependent collections that are available via Ansible Galaxy:

```yaml
---
# galaxy.yml
...
dependencies:
  community.general: "x.x.x"
  # It's not possible to specify it here as a dependent collection, right?

```

I know that a user using my collection could have in their project’s `requirements.yml` file like:

```yaml
---
collections:
  - name: my_namespace.my_collection
  - name: https://github.com/org/theotherdependentcollection.git
    type: git
    version: x.x.x

```

But it just seems a bit clunky. The end user of my collection has to handle this dependent collection themselves, and the niceties of `ansible-galaxy collection install` just installing all the dependent collections required by my collection is lost ☹

Any response is greatly appreciated, thanks all and have a great day.

---

<div class="post-metadata">

**Author:** ![flowerysong](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/flowerysong/32/2305_2.png) [@flowerysong](https://forum.ansible.com/u/flowerysong)\
**Post date:** [August 28, 2025, 7:30pm UTC](https://forum.ansible.com/t/ansible-collections-handling-a-dependent-collection-that-is-only-available-via-scm/44388/2 "2025-08-28T19:30:50Z")

</div>

Installing from git is a not a first-class collection installation method; it’s solely intended as a convenience during development. You should encourage the collection you depend on to actually publish releases. (If it’s private content, the intended solution is to run a private Galaxy-compatible server like Ansible Automation Hub or [amanda](https://github.com/sivel/amanda).)

That being said, I’m pretty sure you can just put the collection name as the repository syntax expected by Galaxy ([Installing collections — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html#installing-a-collection-from-a-git-repository-at-the-command-line)) and it will work.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [August 28, 2025, 7:32pm UTC](https://forum.ansible.com/t/ansible-collections-handling-a-dependent-collection-that-is-only-available-via-scm/44388/3 "2025-08-28T19:32:00Z")

</div>

> [@flowerysong](#):
>
> Installing from git is a not a first-class collection installation method; it’s solely intended as a convenience during development. You should encourage the collection you depend on to actually publish releases

I came here to say this. git is not intended to be a reliable or supported way to distribute collections, and they should be published properly.

---

<div class="post-metadata">

**Author:** ![dbrennand](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dbrennand/32/7830_2.png) [@dbrennand](https://forum.ansible.com/u/dbrennand)\
**Post date:** [August 28, 2025, 10:11pm UTC](https://forum.ansible.com/t/ansible-collections-handling-a-dependent-collection-that-is-only-available-via-scm/44388/4 "2025-08-28T22:11:14Z")

</div>

Hi both,

Thank you for your quick responses 👍

I tried what you suggested @flowerysong and it works well. Thank you 🙂

```yaml
# galaxy.yml
---
dependencies:
  git+https://github.com/vmware/ansible-for-nsxt.git: "master"

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [September 27, 2025, 10:11pm UTC](https://forum.ansible.com/t/ansible-collections-handling-a-dependent-collection-that-is-only-available-via-scm/44388/5 "2025-09-27T22:11:36Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
