ansible-vault Command Examples

Encrypt and decrypt values, data structures and files within Ansible projects. More information: https://docs.ansible.com/ansible/latest/user_guide/vault.html#id17.

ansible-vault create {{vault_file}}

ansible-vault create --vault-password-file {{password_file}} {{vault_file}}

ansible-vault encrypt --vault-password-file {{password_file}} {{vault_file}}

ansible-vault encrypt_string

ansible-vault view --vault-password-file {{password_file}} {{vault_file}}

ansible-vault rekey --vault-password-file {{old_password_file}} --new-vault-password-file {{new_password_file}} {{vault_file}}