# AAP2, installing a collection from a requirements.yml

**URL:** <https://forum.ansible.com/t/aap2-installing-a-collection-from-a-requirements-yml/6315>\
**Category:** Get Help\
**Tags:** collections\
**Created:** [June 12, 2024, 11:34am UTC](https://forum.ansible.com/t/aap2-installing-a-collection-from-a-requirements-yml/6315 "2024-06-12T11:34:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.ansible.com/u/johan)\
**Post date:** [June 12, 2024, 11:34am UTC](https://forum.ansible.com/t/aap2-installing-a-collection-from-a-requirements-yml/6315/1 "2024-06-12T11:34:11Z")

</div>

Hello guys, please allow me a quick question about the collections/requirements.yml file you can put in a project to download collections dependencies, in an AAP2 context.

For example, let’s consider this one :

```auto
---
collections:
  - name: community.general
    type: git
    source: https://gitlab.com/myurl/community-general-9.0.1

```

First, is it possible to point directly to a tar.gz file hosted in a git repository, rather than a repo where the collection has been uncompressed ?

Second, how do you handle the case where the collection is hosted in a repo which necessites credentials different from those of the main repo, where the projects and requirements file are hosted ? In AAP2, as fars as i could see, you can only put one SCM credential for a project. May be by defining a custom credential ?

thanks in advance if you have lights on these topics,  
johan

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [July 1, 2024, 8:04pm UTC](https://forum.ansible.com/t/aap2-installing-a-collection-from-a-requirements-yml/6315/2 "2024-07-01T20:04:44Z")

</div>

1. I believe you can if you use type `url`. [Installing collections — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html#install-multiple-collections-with-a-requirements-file)
2. Since your using git, you would need to tell git which credentials to use for each repo. See these docs here for some options [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)  
I think I would try using an ssh\_config file on the ansible controller/execution env to control what credentials are used but ive never actually done it.

---

<div class="post-metadata">

**Author:** ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.ansible.com/u/johan)\
**Post date:** [July 3, 2024, 5:01am UTC](https://forum.ansible.com/t/aap2-installing-a-collection-from-a-requirements-yml/6315/3 "2024-07-03T05:01:42Z")

</div>

hello,  
Thank you, for 1. I realize that I made an error when trying to download from an url (I didn’t change the type, leaving it to file).  
For the 2., i will need a bit of time - that i haven’t currently - to play with ssh\_config, but I keep that in mind,; thanks !
