Obfuscate password in the Ansible Vault

10 views
Skip to first unread message

Poemy

unread,
Feb 19, 2020, 10:21:40 AM2/19/20
to Ansible Project
Hi,

My playbook installs Docker on a remote server, and logs in on a docker registry by using user credentials, specified by following task
- name: Log into FIS registry
  docker_login:
    registry: my-company-docker-registry
    username: my-user-account
    password: my-password-in-plain-text

Now, what I want to achieve is that my password is stored in the ansible vault and gets decrypted back from the ansible vault.
This to have no plain password anymore in my playbook.
But how do I achieve this?

Vishal Bobade

unread,
Feb 19, 2020, 10:29:30 AM2/19/20
to ansible...@googlegroups.com
Hi, 

Do encrypt your string with ansible-vault encrypt command and assign a variable to it.

You can use that variable in vars Or defaults dir in any role. 



Check below link. 



--
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/7e116a8b-4fcc-4b80-b02e-0a4bb0b2ce1f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages