community.vmware.vmware_host_facts - vcenter username/pass

13 views
Skip to first unread message

Tony Wong

unread,
Mar 14, 2023, 1:26:16 PM3/14/23
to Ansible Project
can i get help on how to put my vcenter credentials 

vcenter_username
vcenter_password 

into a vault file and then run playbook using vault file. I dont want to put the info into the pb

thanks

Will McDonald

unread,
Mar 14, 2023, 2:15:44 PM3/14/23
to ansible...@googlegroups.com

For example:

$ mkdir -p ./inventories/group_vars/all/{vars,vault}

$ ansible-vault create ./inventories/group_vars/all/vault/all.yml

$ ansible-vault edit ./inventories/group_vars/all/vault/all.yml
vaulted_vcenter_username: <username>
vaulted_vcenter_password: <password>

$ vim ./inventories/group_vars/all/vars/all.yml
vcenter_username: "{{ vaulted_vcenter_username }}"
vcenter_password: "{{ vaulted_vcenter_password }}"

Then use vcenter_username & vcenter_password in your roles or plays (with a .vault_pass or --ask-vault-pass as required).


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f64d4585-0e60-46ca-92db-15be933d9162n%40googlegroups.com.

Tony Wong

unread,
Mar 14, 2023, 4:07:40 PM3/14/23
to ansible...@googlegroups.com
Thank you!

You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/FeedrbmYWlg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAKtKohSyKHnU-0Ain55FesVbdEeeGJSFNVX8Jp%3DqayVawT8Ztg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages