git - How to diff ansible vault changes? -
i'd see actual git commit changes in ansible vault file.
is there easy way how achieve this?
you can neatly, normal git tools git log , git diff can see inside vaulted files, using custom git diff driver , .gitattributes.
- make sure vault password in
.vault_password, that file not committed - should add.gitignore. add
.gitattributesfile matches files in repository encrypted ansible-vault , give them attributediff=ansible-vault. example, have:env_vars/production.yml diff=ansible-vault merge=binary env_vars/staging.yml diff=ansible-vault merge=binaryyou can use wildcarded patterns - first element of each line, pattern, follows same rules
.gitignorefiles.merge=binaryoption tells git not attempt three-way merge of these files.then have set diff driver files attribute
diff=ansible-vaultansible-vault view:git config --global diff.ansible-vault.textconv "ansible-vault view"
and should - when git calculating diffs of files pattern matches, it'll decrypt them first.
Comments
Post a Comment