Check The Difference Between Files Encrypted With Ansible-Vault With Git Diff.
git diffwill explain how to make the difference of the encrypted file in ansible-vault visible in.
Allows you to view vault files without a password
./ansible.cfgin the project home directory.
# Specify the path of the file that stores the ansible-vault password
vault_password_file = ./.vault_password
Create a file to store the password (here
Add the password file to to prevent accidental commits to the repository in
Set the text converter for vault files to ansible-vault
~/.gitconfigadd the following description.
textconv = ansible-vault view
cachetextconv = true
- Specify the path of the vault file
# *-vault.yml * .vault.yml can also be specified with wildcard
sample.vault.yml diff = ansible-vault merge = binary
Check file differences
git diffin you will be able to see the differences of the vault file.
$ git diff
diff --git i/sample.vault.yml w/sample.vault.yml
index 0a181e0..658372b 100644
@@ -1,2 +1,2 @@
-test = test
+test = testtest
Diffs in encrypted files are now visible in ansible-vault, making it easier to inadvertently notice mistakes.
- Ansible.cfg specification
Configuring Ansible - Ansible Documentation
This topic describes how to control Ansible settings. Certain settings in Ansible are adjustable via a configuration…
- .gitattributes, .gitconfig specifications