Ansible Builder installing collections and components with no access to galaxy

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 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

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:
    additional_build_files:
      - src: path/to/collection.tar.gz
        dest: src
    
  2. In the Galaxy requirements file, you need to list all these collections:
    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.)

2 Likes

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

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