atom-ansible-vault icon indicating copy to clipboard operation
atom-ansible-vault copied to clipboard

Re-encrypt only if contents change

Open jhkrischel opened this issue 7 years ago • 4 comments

Since ansible-vault encryption uses a random salt, even if you make no changes to the text, on re-encryption, the file will change.

As an enhancement, revert to the original encrypted file if no changes to the decrypted file are made, when the editor is closed.

jhkrischel avatar Jun 28 '17 16:06 jhkrischel

I know it. Possible solution is to check if file is in a git repository and checkout the file to preserve encryption. I think that other possibilities there aren't

sydro avatar Jun 28 '17 16:06 sydro

can't you hook into ansible-vault view to grep a detached copy of the file? (ansible 2.3+ only though)

flamein avatar Jul 07 '17 08:07 flamein

Big +1 to this.

matthew-goldman avatar Sep 28 '18 15:09 matthew-goldman

related - decrypting the file (manually) also seems to save the file.

  1. open file
  2. manually decrypt
  3. close file. No prompt to save since the local file is already changed.

rohku avatar Jun 25 '19 17:06 rohku