Check The Difference Between Files Encrypted With Ansible-Vault With Git Diff.

Introduction

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

Create file ./ansible.cfgin the project home directory.

Create a file to store the password (here .vault_password)

Add the password file to to prevent accidental commits to the repository in .gitignore

Set the text converter for vault files to ansible-vault

  • .git/configOr ~/.gitconfigadd the following description.
  • Specify the path of the vault file

Check file differences

Now, git diffin you will be able to see the differences of the vault file.

End

Diffs in encrypted files are now visible in ansible-vault, making it easier to inadvertently notice mistakes.

Reference

  • Ansible.cfg specification
  • .gitattributes, .gitconfig specifications

DevOps Consultant. I’m strongly focused on automation, security, and reliability.