# How to use galaxy in awx

**URL:** <https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383>\
**Category:** AWX Project\
**Tags:** awx, galaxy-ng, kubernetes\
**Created:** [July 13, 2020, 10:07am UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383 "2020-07-13T10:07:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Selvam\_Elangovan](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Selvam\_Elangovan](https://forum.ansible.com/u/Selvam_Elangovan)\
**Post date:** [July 13, 2020, 10:07am UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/1 "2020-07-13T10:07:51Z")

</div>

Hi!

I plan to install collections in awx. Could some one guide me? I use Awx in kubernetes.

It is a netapp collections:

Finally, you need the NetApp collections and the collections directory to allow all users access

$ sudo ansible-galaxy collection install netapp.ontap netapp.elementsw -p /usr/share/ansible/collections  
$ sudo chmod +rx /usr/share/ansible/collections

Thanks & Regards,  
Selvam E.

---

<div class="post-metadata">

**Author:** ![sdmorel](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sdmorel](https://forum.ansible.com/u/sdmorel)\
**Post date:** [July 13, 2020, 12:14pm UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/2 "2020-07-13T12:14:42Z")

</div>

Hello,

If you have a collections/requirements.yml in your project, AWX will read it and install the collections from it.  
Example of requirements.yml:

---

<div class="post-metadata">

**Author:** ![Selvam\_Elangovan](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Selvam\_Elangovan](https://forum.ansible.com/u/Selvam_Elangovan)\
**Post date:** [July 14, 2020, 2:28am UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/3 "2020-07-14T02:28:24Z")

</div>

Thanks.

---

<div class="post-metadata">

**Author:** ![Selvam\_Elangovan](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Selvam\_Elangovan](https://forum.ansible.com/u/Selvam_Elangovan)\
**Post date:** [July 15, 2020, 4:51am UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/4 "2020-07-15T04:51:41Z")

</div>

one more quick clarification. can we use different source in requirements.yaml file for SCM project?

---

<div class="post-metadata">

**Author:** ![sdmorel](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sdmorel](https://forum.ansible.com/u/sdmorel)\
**Post date:** [July 15, 2020, 7:00am UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/5 "2020-07-15T07:00:52Z")

</div>

Well,

According to the docs, yes. You can install collections from a private Git repository if needed.  
**[https://docs.ansible.com/ansible/devel/user\_guide/collections\_using.html#installing-a-collection-from-a-git-repository](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html#installing-a-collection-from-a-git-repository)**

---

<div class="post-metadata">

**Author:** ![Daniel2](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@Daniel2](https://forum.ansible.com/u/Daniel2)\
**Post date:** [September 23, 2020, 10:40pm UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/6 "2020-09-23T22:40:13Z")

</div>

So if I read from the link that Sergio posted, I can untar the collection into a git repo and put the link in the playbook and it should work instead of having to go into the Docker container and do the ansible-galaxy install, correct?

"[Installing a collection from a git repository](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html#id6)

You can install a collection in a git repository by providing the URI to the repository instead of a collection name or path to a tar.gz file. The collection must contain a galaxy.yml file, which will be used to generate the would-be collection artifact data from the directory. The URI should be prefixed with git+ (or with git@ to use a private repository with ssh authentication) and optionally supports a comma-separated [git commit-ish](https://git-scm.com/docs/gitglossary#def_commit-ish) version (for example, a commit or tag)."

Sorry, I have very new to Ansible AWX and navigating Docker. Currently I would much rather not have to tweak the AWX Docker Container.

Thank you

Daniel

---

<div class="post-metadata">

**Author:** ![Daniel2](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@Daniel2](https://forum.ansible.com/u/Daniel2)\
**Post date:** [September 23, 2020, 11:07pm UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/7 "2020-09-23T23:07:35Z")

</div>

I spent a few hours last night trying to run a playbook with some AWS collections, but I installed the collection at the Linux layer not inside the Docker container, that is what I came to, is I would have to run install inside of Docker container, but If I can reference a GitLab repo, that leaves that Docker repo pristine.

Thank you  
Daniel

---

<div class="post-metadata">

**Author:** ![sdmorel](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sdmorel](https://forum.ansible.com/u/sdmorel)\
**Post date:** [September 29, 2020, 11:54am UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/8 "2020-09-29T11:54:06Z")

</div>

Hello,

Read my first answer again, you only need to add **collections/requirements.yml** to your project, then AWX will read it and install the collections from it  
No need to manually install the collections inside the Docker containers.

---

<div class="post-metadata">

**Author:** ![Vibin](https://avatars.discourse-cdn.com/v4/letter/v/2bfe46/32.png) [@Vibin](https://forum.ansible.com/u/Vibin)\
**Post date:** [March 16, 2021, 3:29pm UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/9 "2021-03-16T15:29:57Z")

</div>

Hello,

Can I have an example requirements.yml file to install the collection from a git repository.

To test, I cloned the community.windows git repository nd uploaded to my private repository.

Now, I’d like to install it via requirements.yml file in my project directory. I’m on AWX 14 and ansible version 2.9

I tried the following but with no luck.

collections:

- name: community.windows  
src: https://\*.git  
type: git  
version: master

Any help would be much appreciated.

---

<div class="post-metadata">

**Author:** ![ffirg](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ffirg/32/10029_2.png) [@ffirg](https://forum.ansible.com/u/ffirg)\
**Post date:** [March 17, 2021, 9:42am UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/10 "2021-03-17T09:42:16Z")

</div>

Have a look at my example here: [https://github.com/ffirg/tower\_collection\_example](https://github.com/ffirg/tower_collection_example)

---

<div class="post-metadata">

**Author:** ![Vibin](https://avatars.discourse-cdn.com/v4/letter/v/2bfe46/32.png) [@Vibin](https://forum.ansible.com/u/Vibin)\
**Post date:** [March 17, 2021, 6:10pm UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/11 "2021-03-17T18:10:53Z")

</div>

Guess, my question was not clear enough.

I was actually looking for a requirements.yml file which references a private git repository.

If I read the documentation correctly, its not possible with ansible version 2.9 and Redhat has not released 2.10.

Regards,  
Vibin

---

<div class="post-metadata">

**Author:** ![ffirg](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ffirg/32/10029_2.png) [@ffirg](https://forum.ansible.com/u/ffirg)\
**Post date:** [March 17, 2021, 6:23pm UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/12 "2021-03-17T18:23:45Z")

</div>

What do you mean by a private repo? Hidden behind a firewall on the corp lan, or a github hosted one which is marked as private?  
What credentials, if any, do you need to gain access?

---

<div class="post-metadata">

**Author:** ![Vibin](https://avatars.discourse-cdn.com/v4/letter/v/2bfe46/32.png) [@Vibin](https://forum.ansible.com/u/Vibin)\
**Post date:** [March 18, 2021, 5:51pm UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/13 "2021-03-18T17:51:24Z")

</div>

Hello,

We use a stash repository behind firewall in the corp lan.

No access outside.

Regards,  
Vibin

---

<div class="post-metadata">

**Author:** ![ffirg](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ffirg/32/10029_2.png) [@ffirg](https://forum.ansible.com/u/ffirg)\
**Post date:** [March 18, 2021, 8:00pm UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/14 "2021-03-18T20:00:41Z")

</div>

stash = bitbucket = git does it not? Not sure why you can’t use that, but you haven’t provided much detail around what’s going on, so its hard to help!

Have you tried any of these:

```auto
# from Bitbucket
- src: git+[https://bitbucket.org/willthames/git-ansible-galaxy](https://bitbucket.org/willthames/git-ansible-galaxy)
  version: v1.4

# from Bitbucket, alternative syntax and caveats
- src: [https://bitbucket.org/willthames/hg-ansible-galaxy](https://bitbucket.org/willthames/hg-ansible-galaxy)
  scm: hg

# from GitLab or other git-based scm, using git+ssh
- src: git@gitlab.company.com:mygroup/ansible-base.git
  scm: git
  version: "0.1" # quoted, so YAML doesn't parse this as a floating-point value

```

```auto

```

---

<div class="post-metadata">

**Author:** ![Vibin](https://avatars.discourse-cdn.com/v4/letter/v/2bfe46/32.png) [@Vibin](https://forum.ansible.com/u/Vibin)\
**Post date:** [March 19, 2021, 10:23am UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/15 "2021-03-19T10:23:02Z")

</div>

Sorry for the lack of information.

Let me update you on background.

My Awx environment runs on K8s and the ansible version is 2.9

Now my customers want to make use of ansible collections and I’d like that to be managed from their end rather than me installing it everytime.

Thats when the collections/requirements.yml came in to picture. So that they can download the required collections and store them in git repository and point to that repo in requirements.yml in their project.

But the problem seems to be this ‘git+https’ is only supported from ansible version 2.10

[https://github.com/ansible](https://github.com/ansible) collections/community.sops/issues/5

So now I created a custom virtual environment with ansible-base version 2.10 and enabled the venv in the project GUI but it doesn’t seem to take it and runs using the default ansible environment.

To double check anything wrong with the custom venv, I ran a job template using the venv and it worked as expected.

So the only problem is now with project updates not picking up the custom venv during sync from git.

Is this a bug or am I doing something wrong? Appreciate your time and support.

Regards,  
Vibin

---

<div class="post-metadata">

**Author:** ![ffirg](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ffirg/32/10029_2.png) [@ffirg](https://forum.ansible.com/u/ffirg)\
**Post date:** [March 22, 2021, 11:06pm UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/16 "2021-03-22T23:06:43Z")

</div>

I think the project syncs only run from the internal awx venv which shouldn’t be modified. JT’s are different.  
Soon this shouldn’t be a problem as we’re moving away from venvs to something called execution environments, but that’s not quite here yet.

So why doesn’t setting an SCM credential against the internal repos you’re trying to use work?

---

<div class="post-metadata">

**Author:** ![Vibin](https://avatars.discourse-cdn.com/v4/letter/v/2bfe46/32.png) [@Vibin](https://forum.ansible.com/u/Vibin)\
**Post date:** [March 24, 2021, 1:12pm UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/17 "2021-03-24T13:12:10Z")

</div>

Guess, its because the format what we are giving in requirements.yml is not being recognized in ansible version 2.9

---

<div class="post-metadata">

**Author:** ![Andre\_Semek](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Andre\_Semek](https://forum.ansible.com/u/Andre_Semek)\
**Post date:** [March 31, 2021, 9:16am UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/18 "2021-03-31T09:16:26Z")

</div>

Hello.

I’ve been trying to get collections running for two days without success. To be honest, I don’t quite understand it yet and unfortunately find the documentation unhelpful. Can anyone help me or explain how it works with an example !?

I’m using the latest AWX version 18.0.0 and I ALWAYS get this message no matter what I try:

_config file = None_

_configured module search path = [‘/home/runner/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]_

_ansible python module location = /usr/local/lib/python3.8/site-packages/ansible_

_ansible collection location = /runner/requirements\_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections_

_executable location = /usr/local/bin/ansible-playbook_

_python version = 3.8.3 (default, Aug 31 2020, 16:03:14) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]_

_jinja version = 2.10.3_

_libyaml = True_

_No config file found; using defaults_

_setting up inventory plugins_

_host\_list declined parsing /runner/inventory/hosts as it did not pass its verify\_file() method_

_Parsed /runner/inventory/hosts inventory source with script plugin_

_redirecting (type: modules) ansible.builtin.win\_chocolatey to chocolatey.chocolatey.win\_chocolatey_

_ERROR! couldn’t resolve module/action ‘win\_chocolatey’. This often indicates a misspelling, missing collection, or incorrect module path._

_The error appears to be in ‘/runner/project/windows/roles/install\_software/tasks/main.yml’: line 2, column 3, but may_

_be elsewhere in the file depending on the exact syntax problem._

_The offending line appears to be:_

---

<div class="post-metadata">

**Author:** ![Chris\_Paggen](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@Chris\_Paggen](https://forum.ansible.com/u/Chris_Paggen)\
**Post date:** [April 27, 2021, 8:51am UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/19 "2021-04-27T08:51:55Z")

</div>

Same issue as you. Did you ever get this resolved? I tried many different requirements.yml (under directory collections; in the main directory; pointing to Git, pointing to a local gz archive, pointing to the name of the collection as used with ansible-galaxy collection install) and it’s as if AWX simply ignores this. It keeps producing the same error as you no matter what I use. If I enter random options in requirements.yml, same thing. Not even an error message telling me the option is invalid. Everything leads to AWX not trying to install the collection at all. Odd, and difficult to troubleshoot.

---

<div class="post-metadata">

**Author:** ![Chris\_Paggen](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@Chris\_Paggen](https://forum.ansible.com/u/Chris_Paggen)\
**Post date:** [April 27, 2021, 12:33pm UTC](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383/20 "2021-04-27T12:33:27Z")

</div>

Solved with a custom EE. See [https://www.linkedin.com/pulse/creating-custom-ee-awx-phil-griffiths/](https://www.linkedin.com/pulse/creating-custom-ee-awx-phil-griffiths/) for steps, it worked like a charm for me.

[Next page](https://forum.ansible.com/t/how-to-use-galaxy-in-awx/33383.md?page=2)
