how do i setup a vault password for administraator@vsphere.local

16 views
Skip to first unread message

Tony Wong

unread,
Jun 5, 2020, 7:23:13 PM6/5/20
to Ansible Project
How do I setup a vault password for user

admini...@vsphere.local?

Abhijeet Kasurde

unread,
Jun 6, 2020, 1:35:13 AM6/6/20
to ansible...@googlegroups.com
# echo Secret123 > vault_passwd
# ansible-vault Esxi@123$% --name vcenter_password --vault-id my_user@vault_passwd
vcenter_password: !vault |
          $ANSIBLE_VAULT;1.2;AES256;my_user
          64323237323838303636616564643533353134663337316434326339643733613036623839643962
          3466623963643136653661636663313334333661616533640a313730626238303630636230376338
          63643638313835663563633664653163643765383935376234386635303534343966626130323164
          3731363638356264630a393934323930366365366132626132633862656636343365623865393331
          6362
Encryption successful
# cat vcenter_vars.yml
vcenter_hostname: 10.65.201.2
vcenter_username: admini...@vsphere.local
vcenter_password: !vault |
          $ANSIBLE_VAULT;1.2;AES256;my_user
          64323237323838303636616564643533353134663337316434326339643733613036623839643962
          3466623963643136653661636663313334333661616533640a313730626238303630636230376338
          63643638313835663563633664653163643765383935376234386635303534343966626130323164
          3731363638356264630a393934323930366365366132626132633862656636343365623865393331
          6362
#  cat main.yml
---
- hosts: localhost
  vars_files:
    - vcenter_vars.yml
  tasks:
    - name: Debug
      debug:
        msg: "{{ vcenter_password }}"

# ansible-playbook main.yml --vault-password-file vault_passwd
...
ok: [localhost] => {
    "msg": "Esxi@123$%"
}
...

On Sat, Jun 6, 2020 at 4:53 AM Tony Wong <tdub...@gmail.com> wrote:
How do I setup a vault password for user

admini...@vsphere.local?

--
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/08387d34-84b8-4de0-a6d2-4b48c6373c63o%40googlegroups.com.


--
Thanks,
Abhijeet Kasurde
Reply all
Reply to author
Forward
0 new messages