# Hashicorp Vault Integration With Ansible Automation Platform 2.5

**URL:** <https://forum.ansible.com/t/hashicorp-vault-integration-with-ansible-automation-platform-2-5/39575>\
**Category:** Get Help\
**Tags:** aap, awx, ee\
**Created:** [January 13, 2025, 4:37pm UTC](https://forum.ansible.com/t/hashicorp-vault-integration-with-ansible-automation-platform-2-5/39575 "2025-01-13T16:37:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![selvigp](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/selvigp/32/4977_2.png) [@selvigp](https://forum.ansible.com/u/selvigp)\
**Post date:** [January 13, 2025, 4:37pm UTC](https://forum.ansible.com/t/hashicorp-vault-integration-with-ansible-automation-platform-2-5/39575/1 "2025-01-13T16:37:15Z")

</div>

**Hashicorp Vault Integration With AAP 2.5** :

- Deployed containerized AAP 2.5 on a linux host. Hashicorp vault is also deployed as a container in the same network range.
- Downloaded community.hashi\_vault ansible collection and uploaded into AAP UI. I have checked it under Automation content → Collections, hashi\_vault is available there.
- Now, I have created playbook to fetch secrets from hashicorp vault.
- I have created projects and defined a gitlab repo where I have placed my playbooks.
- Chosen default execution environments to run my playbook, pass vault\_addr and vault\_token as an env variables.

Issues:-

- While running my job templates, I am getting below errors  
-`ERROR! couldn't resolve module/action 'community.hashi_vault.vault_kv2_get'. This often indicates a misspelling, missing collection, or incorrect module path.`

Did anyone have idea how to fix it? I have tried many ways each way getting some error. Do I need install pip hvac on the execution environment in order to use vault in my playbook. If it is, how shall I implement there?

---

<div class="post-metadata">

**Author:** ![anon81884396](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon81884396](https://forum.ansible.com/u/anon81884396)\
**Post date:** [January 13, 2025, 7:45pm UTC](https://forum.ansible.com/t/hashicorp-vault-integration-with-ansible-automation-platform-2-5/39575/2 "2025-01-13T19:45:49Z")

</div>

I’m not familiar with how AAP does things, but typically if a project in AWX needs to utilize a collection, it has to be called out in `collections/requirements.yml` in the code repository for your project and by extension the job template.

```auto
---
collections:
  - name: community.hashi_vault

```

I see [Ansible Galaxy](https://galaxy.ansible.com/ui/repo/published/community/hashi_vault/) is on the public galaxy, so if you want to use your private galaxy, you’d probably need to point it there explicitly.

Sorry if this info isn’t relevant to you, but I figure it’s worth sharing since AAP is based on AWX and I didn’t see this info in your post as something you tried.

---

<div class="post-metadata">

**Author:** ![selvigp](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/selvigp/32/4977_2.png) [@selvigp](https://forum.ansible.com/u/selvigp)\
**Post date:** [January 13, 2025, 8:20pm UTC](https://forum.ansible.com/t/hashicorp-vault-integration-with-ansible-automation-platform-2-5/39575/3 "2025-01-13T20:20:52Z")

</div>

Hi,

Thanks for your info. I have tried that method as well, created collections/ requirements.yml and mentioned about vault collection there. In this scenario, my project sync is failing if i removed collection dir from repo, it is working fine. I dont understand the cause behind that.

Getting kind of depreciation warning for Ansible collection path. Should it be any issue if i run everying in a private network. I mean internet is not available in the ansi ble server

---

<div class="post-metadata">

**Author:** ![anon81884396](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon81884396](https://forum.ansible.com/u/anon81884396)\
**Post date:** [January 13, 2025, 8:33pm UTC](https://forum.ansible.com/t/hashicorp-vault-integration-with-ansible-automation-platform-2-5/39575/4 "2025-01-13T20:33:51Z")

</div>

Interesting, sounds like maybe you need to specify the Galaxy server. I’m not sure how it’s done in AAP (like I said earlier) but [Installing collections — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html#install-multiple-collections-with-a-requirements-file)

This is an example file:

```auto
collections:
  # Install a collection from Ansible Galaxy.
  - name: geerlingguy.php_roles
    version: ">=0.9.3"
    source: https://galaxy.ansible.com

```

You’d edit the “source” to be your AAP Galaxy. I don’t know what that would be in the AAP ecosystem.

Might also help if you pasted the error that you see during project sync.

---

<div class="post-metadata">

**Author:** ![selvigp](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/selvigp/32/4977_2.png) [@selvigp](https://forum.ansible.com/u/selvigp)\
**Post date:** [January 13, 2025, 9:11pm UTC](https://forum.ansible.com/t/hashicorp-vault-integration-with-ansible-automation-platform-2-5/39575/5 "2025-01-13T21:11:51Z")

</div>

I am getting below errors while project sync if I specify requirements.yml in the repo.

```auto
TASK [Fetch galaxy collections from collections/requirements.(yml/yaml)] *******
28
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["ansible-galaxy", "collection", "install", "-r", "/home/aapinst/aap/controller/data/projects/_11__vault_test/collections/requirements.yml"], "delta": "0:03:00.816566", "end": "2025-01-13 20:16:04.849047", "msg": "non-zero return code", "rc": 1, "start": "2025-01-13 20:13:04.032481", "stderr": "[DEPRECATION WARNING]: ANSIBLE_COLLECTIONS_PATHS option, does not fit var \nnaming standard, use the singular form ANSIBLE_COLLECTIONS_PATH instead. This \nfeature will be removed from ansible-core in version 2.19. Deprecation warnings\n can be disabled by setting 

```

---

<div class="post-metadata">

**Author:** ![anon81884396](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon81884396](https://forum.ansible.com/u/anon81884396)\
**Post date:** [January 13, 2025, 9:40pm UTC](https://forum.ansible.com/t/hashicorp-vault-integration-with-ansible-automation-platform-2-5/39575/6 "2025-01-13T21:40:34Z")

</div>

I think your error paste got cut off prematurely since there isn’t a closing curly brace

---

<div class="post-metadata">

**Author:** ![selvigp](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/selvigp/32/4977_2.png) [@selvigp](https://forum.ansible.com/u/selvigp)\
**Post date:** [January 14, 2025, 7:56am UTC](https://forum.ansible.com/t/hashicorp-vault-integration-with-ansible-automation-platform-2-5/39575/7 "2025-01-14T07:56:45Z")

</div>

Yeah, but I got only this. It is disconnected; no message prints after that.  
I have uploaded ansible collection in the AAP, (Under Automation hub → Collections) but how should my requirements.yml identify the collection path to install it on the execution environment, where I am running my playbooks.

Do I need to specify any path location for the same in the yaml manifests or how exactly it works?

---

<div class="post-metadata">

**Author:** ![anon81884396](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon81884396](https://forum.ansible.com/u/anon81884396)\
**Post date:** [January 14, 2025, 4:40pm UTC](https://forum.ansible.com/t/hashicorp-vault-integration-with-ansible-automation-platform-2-5/39575/8 "2025-01-14T16:40:55Z")

</div>

Not sure, wish I had an AAP instance myself I could hunt around for. I use the Ansible Galaxy operator and have an on-prem instance of Galaxy, so I know what its URL is.

When you upload a collection, does it give you any clues as to what the server URL is for that collection? Also, if you’re using AAP, could you open a ticket to RedHat to have them take look for you?

---

<div class="post-metadata">

**Author:** ![selvigp](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/selvigp/32/4977_2.png) [@selvigp](https://forum.ansible.com/u/selvigp)\
**Post date:** [January 14, 2025, 7:33pm UTC](https://forum.ansible.com/t/hashicorp-vault-integration-with-ansible-automation-platform-2-5/39575/9 "2025-01-14T19:33:50Z")

</div>

No, I didn’t get any messages when I uploaded a collection. I have no idea about where to define those parameters in the AAP. I will check somewhere in the documents and see whether I can able to figure it out or not.
