How to pass credentials to a playbook deploying VMWare VMs #195
-
Hi, cannot find on how to pass the credentials to a playbook. Using this collection: https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_module.html regards.. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 16 replies
-
what exactly is not working? you can pass the stored credentials in several ways. with the form property "credentials" or with a field called credentials or by adding "asCredential" property to a field. each time you pass the name of the credentials and they will be injected as a dict with all properties like user, password. the password is encrypted in the database. make a simple playbook and debug the credentials object to see all the properties. |
Beta Was this translation helpful? Give feedback.
-
Lacking ansible skills or missing a dev background or I must as be dumb as they come :) |
Beta Was this translation helpful? Give feedback.
-
Is there a future plan to add ssh keys as credentials? |
Beta Was this translation helpful? Give feedback.
so, store credentials and give them a name. example vcenter
then you can inject them as extravars by either:
forms property credentials
this injects the vcenter credentials and expose them as the extravar dict variable vmware
then you can do
just use them as variables
but sometimes you want to choose the credential name from within the form, so you can then make a text field or expression or enum field and its value will be the credential name. simply add the property asCredential to the field.