How to decrypt string with ansible-vault 2.3.0

Question:

I have been waiting for ansible 2.3 as it was going to introduce encrypt_string feature.

Unfortuately I’m not sure how can I read the encrypted string.

I did try decrypt_string, decrypt (the file), view (the file) and nothing works.

The error I’m geeting is ERROR! input is not vault encrypted data for test.yml

How can I decrypt the string so I know what it’s value without the need to run the play?

Answer:

Did you try setting the encrypted string as a variable and then using -debug to get its decrypted output?

i.e.

Define your encrypted string as a variable test in your playbook and then do:


in your playbook and then run the playbook:

Leave a Reply