# How to access AWX credential store from a Playbook?

**URL:** <https://forum.ansible.com/t/how-to-access-awx-credential-store-from-a-playbook/26638>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [February 2, 2018, 11:13am UTC](https://forum.ansible.com/t/how-to-access-awx-credential-store-from-a-playbook/26638 "2018-02-02T11:13:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claudio\_Patricio\_Rif](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@Claudio\_Patricio\_Rif](https://forum.ansible.com/u/Claudio_Patricio_Rif)\
**Post date:** [February 2, 2018, 11:13am UTC](https://forum.ansible.com/t/how-to-access-awx-credential-store-from-a-playbook/26638/1 "2018-02-02T11:13:08Z")

</div>

Hi there!

Is possible to access the credentials stored in AWX from a Playbook?  
How?

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [February 2, 2018, 2:49pm UTC](https://forum.ansible.com/t/how-to-access-awx-credential-store-from-a-playbook/26638/2 "2018-02-02T14:49:16Z")

</div>

For environment variable and ini-based credentials yes. In general, though, especially for machine credentials… we try to protect those from leaking in any way.

---

<div class="post-metadata">

**Author:** ![Claudio\_Patricio\_Rif](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@Claudio\_Patricio\_Rif](https://forum.ansible.com/u/Claudio_Patricio_Rif)\
**Post date:** [February 4, 2018, 4:47am UTC](https://forum.ansible.com/t/how-to-access-awx-credential-store-from-a-playbook/26638/3 "2018-02-04T04:47:29Z")

</div>

In my case im interested in Machine Credentials.  
Specifically, how to update them from a Playbook.

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [February 5, 2018, 4:53am UTC](https://forum.ansible.com/t/how-to-access-awx-credential-store-from-a-playbook/26638/4 "2018-02-05T04:53:55Z")

</div>

There’s no way to read those values out of the api but you can update them.

---

<div class="post-metadata">

**Author:** ![Claudio\_Patricio\_Rif](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@Claudio\_Patricio\_Rif](https://forum.ansible.com/u/Claudio_Patricio_Rif)\
**Post date:** [February 5, 2018, 7:25am UTC](https://forum.ansible.com/t/how-to-access-awx-credential-store-from-a-playbook/26638/5 "2018-02-05T07:25:38Z")

</div>

ok…  
So delete and create or is there an edit option?  
URI module is the best option?

---

<div class="post-metadata">

**Author:** ![Christopher\_Meyers](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Christopher\_Meyers](https://forum.ansible.com/u/Christopher_Meyers)\
**Post date:** [February 5, 2018, 2:51pm UTC](https://forum.ansible.com/t/how-to-access-awx-credential-store-from-a-playbook/26638/6 "2018-02-05T14:51:16Z")

</div>

Claudio,

I’d suggest tower-cli (a command-line tool for interacting with the tower api), or Ansible core Tower modules. If you must, use the URI module. Edit is available via the PATCH operator. The API is self-browsing, try it out by going to [http://your\_tower\_host/api/v2/](http://your_tower_host/api/v2/)

---

<div class="post-metadata">

**Author:** ![Claudio\_Patricio\_Rif](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@Claudio\_Patricio\_Rif](https://forum.ansible.com/u/Claudio_Patricio_Rif)\
**Post date:** [February 6, 2018, 6:38am UTC](https://forum.ansible.com/t/how-to-access-awx-credential-store-from-a-playbook/26638/7 "2018-02-06T06:38:13Z")

</div>

One more question.

Whats the best way (on AWX) to use credentials on a Playbook?

Basically i’m currently working on automation to deploy some Plesk VMs.  
All VMs get deployed with the same default root password, and i want to change this password for a new one (all vms with the same root password),  
Then, AWX install Plesk panel. I need to setup the admin credentials (Basically the password). I’m also triying to set the same admin password for all VMs.  
Also, what i want to achieve is to rotate root and admin passwords monthly.

So. Whats the recommended approach to achieve this?  
Should i consider using something else instead of AWX Credentials?
