ansible-vault
TLDR
Create a new encrypted file
SYNOPSIS
ansible-vault command [--vault-password-file file] [options] files
DESCRIPTION
ansible-vault encrypts sensitive data like passwords, keys, and credentials within Ansible projects. It uses AES256 encryption to protect files while allowing them to be used directly in playbooks.
Encrypted files can be edited, viewed, and used in playbooks without manual decryption; ansible-playbook handles decryption automatically when provided with the vault password.
PARAMETERS
create file
Create new encrypted fileencrypt files
Encrypt existing filesdecrypt files
Decrypt filesedit file
Edit encrypted file in placeview file
View encrypted file contentsencrypt_string
Encrypt a string for embeddingrekey files
Change encryption password--vault-password-file file
File containing vault password--vault-id label
Vault identity label--ask-vault-pass
Prompt for vault password--new-vault-password-file file
New password file for rekey
CAVEATS
Vault password must be available during playbook runs. Encrypted files should be committed to version control, not the password. Use vault-id for multiple passwords.
HISTORY
ansible-vault was introduced in Ansible 1.5 (2014) to address the need for secure handling of sensitive data in automation. Multiple vault passwords support was added in Ansible 2.4.
SEE ALSO
ansible-playbook(1), ansible(1), gpg(1)


