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
.gitattributes
file 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=binary
you can use wildcarded patterns - first element of each line, pattern, follows same rules
.gitignore
files.merge=binary
option tells git not attempt three-way merge of these files.then have set diff driver files attribute
diff=ansible-vault
ansible-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