Ansible Vault
Ansible's built-in feature and command for encrypting secrets such as passwords and keys so the encrypted files can live in the project.
In more detail
ansible-vault create, edit and encrypt write files whose content is AES256 ciphertext under a one-line header naming the format, and playbooks decrypt them in memory when given the vault password. Vault protects data at rest only: a task that prints or logs a secret still leaks it. Always edit vaulted files with the ansible-vault command; hand-editing the ciphertext corrupts it.
Examples
ansible-vault create group_vars/all/vault.ymlansible-vault edit group_vars/all/vault.ymlRelated terms
- vault password — The password that unlocks Vault-encrypted data; Ansible needs it at run time and it must never be stored in the repository.
- vault ID — A label attached to Vault-encrypted data that names which password protects it, so one project can use different passwords for different environments.
- encryption at rest — Protecting stored data, such as files on disk or in a repository, by keeping it encrypted while it is not being used.
- secret — Any value that grants access, such as a password, access token or private key, and must be kept out of code and version control.
- no_log — A task keyword that hides the task's arguments and results from output and logs, used when a task handles a secret.
Taught in
- Testing With Molecule — Ansible Configuration Management at Scale
- Securing Data With Ansible Vault — Ansible Configuration Management at Scale
- Vault IDs And Multiple Passwords — Ansible Configuration Management at Scale
- Environment Specific Configuration — Ansible Configuration Management at Scale
- Performance, Forks And Best Practices — Ansible Configuration Management at Scale
- Users And Groups From A List, With Passwords That Settle — RHCE in Ansible (EX294): Automate Red Hat Systems
- Jinja Templates: One File, A Different Text Per Host — RHCE in Ansible (EX294): Automate Red Hat Systems
- Ansible Vault: Secrets Encrypted, Runs Without A Prompt — RHCE in Ansible (EX294): Automate Red Hat Systems
- Drill: People, Passwords And sudo From The Vault — RHCE in Ansible (EX294): Automate Red Hat Systems
- Mock Exam, Part 1: Seven Tasks Across Three Sections — RHCE in Ansible (EX294): Automate Red Hat Systems