# 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: [email protected]
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 <[email protected]> wrote:

> How do I setup a vault password for user
>
> [email protected]?
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/08387d34-84b8-4de0-a6d2-4b48c6373c63o%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/08387d34-84b8-4de0-a6d2-4b48c6373c63o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Thanks,
Abhijeet Kasurde

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFwWkHr2P2ONM%3DuYG0UjG_O4-2s_efML5fbLz2AQ-qacu2k2zw%40mail.gmail.com.

Reply via email to