# ansible-galaxy download roles for offline installs

**URL:** <https://forum.ansible.com/t/ansible-galaxy-download-roles-for-offline-installs/22992>\
**Category:** Ansible Developer\
**Tags:** galaxy-ng\
**Created:** [November 10, 2016, 2:57am UTC](https://forum.ansible.com/t/ansible-galaxy-download-roles-for-offline-installs/22992 "2016-11-10T02:57:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liam\_Chasteen](https://avatars.discourse-cdn.com/v4/letter/l/9e8a1a/32.png) [@Liam\_Chasteen](https://forum.ansible.com/u/Liam_Chasteen)\
**Post date:** [November 10, 2016, 2:57am UTC](https://forum.ansible.com/t/ansible-galaxy-download-roles-for-offline-installs/22992/1 "2016-11-10T02:57:50Z")

</div>

Hello all-

I’m using Ansible at work to automate various workflows, and one of the requirements is deterministic repeatable installs of the ansible environment. As part of this, all installations need to be able to install in an isolated network environment (ie., no external internet connections). Ansible galaxy provides a means to install roles from local tarballs, but no obvious way to obtain those tarballs directly from the ansible galaxy tool.

I’ve added a new “download” command (borrowing heavily from the install command) that will retrieve the role tarballs (and optionally their dependencies) and save them locally. A user can then use these tarballs to accomplish an offline install at some later point.

The changes are rather minor (only 2 files: lib/ansible/cli/galaxy.py, and lib/ansible/galaxy/role.py). Changes can be viewed in my fork:

[https://github.com/Mojofreem/ansible/tree/download-for-offline-install](https://github.com/Mojofreem/ansible/tree/download-for-offline-install)

s this something that would be considered worthy of upstream inclusion?

If so, Is there anything I should do prior to submitting a pull request?

Regards,  
Liam Chasteen

---

<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:** [November 10, 2016, 10:22am UTC](https://forum.ansible.com/t/ansible-galaxy-download-roles-for-offline-installs/22992/2 "2016-11-10T10:22:19Z")

</div>

A few months ago I did a small server intended for private roles that might help you ([https://github.com/Feverup/ansible-library](https://github.com/Feverup/ansible-library)). It allows to download tarballs not on github but requires a small patch to ansible to work ([https://github.com/ansible/ansible/pull/14779](https://github.com/ansible/ansible/pull/14779)).  
It does proxy standard roles, but does not cache them, so for your use case the easiest should be to manually download roles and then upload into the library. If you decide to give a try, contact me if the small documentation is (likely) not enough.
