I'm running ansible 1.9.4 on OSX installed via pip.
If I do ansible-vault create x
, then make some changes and save, then the file appears blank whenever I do ansible-vault view x
or ansible-vault edit x
.
I've got Sublime Text 3 as my $EDITOR. When I set it to vim instead, it all works as expected, and I can edit and save my files encrypted with ansible-vault. Any idea what could be happening here?
I don't think it'll work with the standard Sublime command line launcher. ansible-vault
waits for the editor process to exit before encrypting the temp file it creates- the Sublime launcher exits immediately, so you end up with an empty vault file.
EDIT:
To make it work with the standard Sublime command line launcher, you have to specify the -w flag, which will stop the subl
process from existing until the file is closed in sublime text. (see docs)
So your .bashrc
should have a line like this:
export EDITOR='subl -w'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With