# Galaxy - Install Role from Subdirectory of Github Repo

**URL:** <https://forum.ansible.com/t/galaxy-install-role-from-subdirectory-of-github-repo/20677>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [February 25, 2016, 2:41pm UTC](https://forum.ansible.com/t/galaxy-install-role-from-subdirectory-of-github-repo/20677 "2016-02-25T14:41:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Allen](https://avatars.discourse-cdn.com/v4/letter/n/b2d939/32.png) [@Nick\_Allen](https://forum.ansible.com/u/Nick_Allen)\
**Post date:** [February 25, 2016, 2:41pm UTC](https://forum.ansible.com/t/galaxy-install-role-from-subdirectory-of-github-repo/20677/1 "2016-02-25T14:41:19Z")

</div>

I have a Github repository that contains multiple roles, each in separate subdirectories. For example, I have separate roles ‘role-alpha’ and ‘role-beta’ in a repo at [https://github.com/whoami/project.git](https://github.com/whoami/project.git) each located in subdirectories as follows.

- provisioning/roles/role-alpha
- provisioning/roles/role-beta

> 

I am trying to install these roles via a ‘requirements.yml’ file by running the following.

`ansible-galaxy install -r requirements.yml`

Can I install roles from a single Github repository that have multiple roles, each in unique subdirectories? What would the definition look like?

`

- name: role-alpha  
src: [https://github.com/whoami/project.git](https://github.com/whoami/project.git)  
???: provisioning/roles/role-alpha  
`

Many thanks for any advice.

---

<div class="post-metadata">

**Author:** ![Chris\_Houseknecht](https://avatars.discourse-cdn.com/v4/letter/c/c57346/32.png) [@Chris\_Houseknecht](https://forum.ansible.com/u/Chris_Houseknecht)\
**Post date:** [February 26, 2016, 1:44pm UTC](https://forum.ansible.com/t/galaxy-install-role-from-subdirectory-of-github-repo/20677/2 "2016-02-26T13:44:35Z")

</div>

The role installation process does not support this at present. We’re in the middle of re-thinking how role installs work. If you’re interested, there is a proposal at [github.com/ansible/ansible](http://github.com/ansible/ansible). Look in docs/proposals.

Combining multiple roles into a single repo makes things like testing, linting and versioning more complicated, so I don’t know that we really want to add this support. However, you can always suggest it and see what the community thinks.

–Chris

---

<div class="post-metadata">

**Author:** ![Franklin\_Wise](https://avatars.discourse-cdn.com/v4/letter/f/8491ac/32.png) [@Franklin\_Wise](https://forum.ansible.com/u/Franklin_Wise)\
**Post date:** [March 18, 2016, 10:45pm UTC](https://forum.ansible.com/t/galaxy-install-role-from-subdirectory-of-github-repo/20677/3 "2016-03-18T22:45:07Z")

</div>

Chris - that makes sense.

However, there’s another use case where the support would be helpful. Which is keeping the ansible role in the same repo as the application it installs. So if I have [github.com/myuser/mycoolapi.git](http://github.com/myuser/mycoolapi.git) I might want to keep the ansible role in a folder within the same mycoolapi that way the role can be versioned with the code it installs. Thoughts?

Franklin

---

<div class="post-metadata">

**Author:** ![Javier\_Palacios](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@Javier\_Palacios](https://forum.ansible.com/u/Javier_Palacios)\
**Post date:** [March 21, 2016, 9:31am UTC](https://forum.ansible.com/t/galaxy-install-role-from-subdirectory-of-github-repo/20677/4 "2016-03-21T09:31:20Z")

</div>

If you don’t mind making a tarball with the roles, you can use [https://github.com/javiplx/ansible-library/](https://github.com/javiplx/ansible-library/), which is basically a install only private galaxy server, from where you can serve your packaged roles (so, it doesn’t matter the tree where they live).

Javier Palacios

---

<div class="post-metadata">

**Author:** ![Aneesh\_Joseph](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Aneesh\_Joseph](https://forum.ansible.com/u/Aneesh_Joseph)\
**Post date:** [July 24, 2016, 5:35am UTC](https://forum.ansible.com/t/galaxy-install-role-from-subdirectory-of-github-repo/20677/5 "2016-07-24T05:35:08Z")

</div>

If you want to pull down the entire Git repo and use the different roles within in it, you just need to have a meta/main.yml file at the repo root. See [https://github.com/ansible/ansible/issues/16804](https://github.com/ansible/ansible/issues/16804) for details
