# Ansible Builder installing collections and components with no access to galaxy

**URL:** <https://forum.ansible.com/t/ansible-builder-installing-collections-and-components-with-no-access-to-galaxy/7974>\
**Category:** Get Help\
**Tags:** ansible-builder, galaxy-ng\
**Created:** [August 20, 2024, 5:10am UTC](https://forum.ansible.com/t/ansible-builder-installing-collections-and-components-with-no-access-to-galaxy/7974 "2024-08-20T05:10:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [August 20, 2024, 5:10am UTC](https://forum.ansible.com/t/ansible-builder-installing-collections-and-components-with-no-access-to-galaxy/7974/1 "2024-08-20T05:10:02Z")

</div>

This is more of a discovery question. I am wanting to use ansible builder in an environment where we have access to a proxied pypi and containter registry (proxied to dockerhub and [quay.io](http://quay.io) but not to ansible-galaxy. What I am wondering is that if I reference my collections to a tar.tgz file. . . will Ansible-Builder try to reach out to galaxy? If so is there any way to turn it off?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [August 20, 2024, 7:22am UTC](https://forum.ansible.com/t/ansible-builder-installing-collections-and-components-with-no-access-to-galaxy/7974/2 "2024-08-20T07:22:23Z")

</div>

Yes, that should work. You need two things:

1. In execution-environment.yml, you need to tell ansible-builder to include the collection tarballs in the build environment:

```auto
additional_build_files:
  - src: path/to/collection.tar.gz
    dest: src

```

2. In the Galaxy requirements file, you need to list all these collections:

```auto
collections:
  - name: src/collection.tar.gz
    type: file

```

You need to make sure that you provide all collections that your collections transitively depend on, otherwise `ansible-galaxy collection install` will try to reach Galaxy.

(Instead you could also set up a proxied Galaxy server, that might be easier to handle long-term.)

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [August 20, 2024, 7:56am UTC](https://forum.ansible.com/t/ansible-builder-installing-collections-and-components-with-no-access-to-galaxy/7974/3 "2024-08-20T07:56:14Z")

</div>

Would love to do that. The problem is that we have to go through dumb approvals to get proxy for Galaxy. 😂

So looking for something to tie us over for the time being. I will give it a shot.
