# AWX Credential usage general and VMware VCenter credential type

**URL:** <https://forum.ansible.com/t/awx-credential-usage-general-and-vmware-vcenter-credential-type/10690>\
**Category:** Get Help\
**Tags:** vmware, awx\
**Created:** [November 4, 2024, 6:41pm UTC](https://forum.ansible.com/t/awx-credential-usage-general-and-vmware-vcenter-credential-type/10690 "2024-11-04T18:41:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveW](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@SteveW](https://forum.ansible.com/u/SteveW)\
**Post date:** [November 4, 2024, 6:41pm UTC](https://forum.ansible.com/t/awx-credential-usage-general-and-vmware-vcenter-credential-type/10690/1 "2024-11-04T18:41:28Z")

</div>

I cannot find information on how to use AWX credentials. Specifically I would like to use the VMware Vcenter credential to authenticate to Vcenter. I am unable to access the vsphere hostname, username or password in my playbooks.  
I cannot find any documentation on AWX credentials other than how to create them. Is there documentation on how to use them in playbooks by reference variables?

---

<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:** [November 4, 2024, 9:17pm UTC](https://forum.ansible.com/t/awx-credential-usage-general-and-vmware-vcenter-credential-type/10690/2 "2024-11-04T21:17:08Z")

</div>

The way AWX does credentials is a bit difficult to wrap one’s head around when you’re first getting started, at least it was for me. So I feel your pain.

AWX comes with several credential types out of the box, and one of them is the “VMware vCenter” credential. Create a new credential by logging in to the UI, and under Resources, click Credentials then add. Select “VMware vCenter” as the type and fill out the info.

Looking at how the cred works, it looks like it creates environment variables instead of extra\_vars. Kinda odd, but they appear to be environment variables named VMWARE\_USER, VMWARE\_PASSWORD, and VMWARE\_HOST. You can set these values via [ansible.builtin.env lookup – Read the value of environment variables — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/env_lookup.html)

Some caveats:

You can only have one credential type associated with a template. Meaning, all your templates using this new “VMware vCenter” credential can only ever have one “VMware vCenter” tied to it at a time (they can have any other credential type tied to it simultaneously, such as Machine, but the rule of only one of those categories of credential type applies as well). So whoever is launching your job may need to pick the correct credential on launch (this is a configurable option on the job template level, “Prompt on launch”).

You may also want to consider using a centralized secrets store like Hashicorp vault, or Azure Key Vault, or the AWS one or whatever since utilizing those gets around some of the stickier problems of using credentials in AWX. That’s kinda like a “day 2 ops” type of thing, I suppose. Or maybe what I wrote above is good enough for your use-case and you don’t need a dedicated secrets store.

At any rate, I hope this is helpful!

---

<div class="post-metadata">

**Author:** ![SteveW](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@SteveW](https://forum.ansible.com/u/SteveW)\
**Post date:** [November 5, 2024, 12:54am UTC](https://forum.ansible.com/t/awx-credential-usage-general-and-vmware-vcenter-credential-type/10690/3 "2024-11-05T00:54:22Z")

</div>

Thank you very much! That is very helpful!
