# Use AWX Credential inside playbook

**URL:** <https://forum.ansible.com/t/use-awx-credential-inside-playbook/29539>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [January 27, 2019, 2:24am UTC](https://forum.ansible.com/t/use-awx-credential-inside-playbook/29539 "2019-01-27T02:24:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![innatenew](https://avatars.discourse-cdn.com/v4/letter/i/bbce88/32.png) [@innatenew](https://forum.ansible.com/u/innatenew)\
**Post date:** [January 27, 2019, 2:24am UTC](https://forum.ansible.com/t/use-awx-credential-inside-playbook/29539/1 "2019-01-27T02:24:26Z")

</div>

Hello all,

I have a use case where I am making a SOAP call via a custom ansible module.  
The call needs credentials to authenticate .

I wanted to know if there was a way to create Credential on AWX and then call them inside the playbook to pass on.

I’d really appreciate an example.

FYI tried to use various credential types and read their environment variable via look up inside playbook but none worked.  
Probably I am doing something wrong.

Thanks for your help!

DR

---

<div class="post-metadata">

**Author:** ![jpmens1](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jpmens1](https://forum.ansible.com/u/jpmens1)\
**Post date:** [January 28, 2019, 9:24am UTC](https://forum.ansible.com/t/use-awx-credential-inside-playbook/29539/2 "2019-01-28T09:24:33Z")

</div>

You can create one or more custom credential types [1] and assign those to your job template. Credentials are stored securely within AWX and are passed into your job (ie playbook) either as extra\_vars or in files, at your decision.

-JP

[1] [https://docs.ansible.com/ansible-tower/latest/html/userguide/credential\_types.html](https://docs.ansible.com/ansible-tower/latest/html/userguide/credential_types.html)

---

<div class="post-metadata">

**Author:** ![innatenew](https://avatars.discourse-cdn.com/v4/letter/i/bbce88/32.png) [@innatenew](https://forum.ansible.com/u/innatenew)\
**Post date:** [January 29, 2019, 4:20am UTC](https://forum.ansible.com/t/use-awx-credential-inside-playbook/29539/3 "2019-01-29T04:20:25Z")

</div>

Thanks JP for your response

I did create custom credentials earlier as also mentioned in my but I was not using them right, your response did make me look at it again...and fix a very stupid mistake

Thanks again  
DR
