Skip to content

Commit 0a84867

Browse files
bcocaoraNod
andauthored
ansible-vault show how to decrypt strings (ansible#2238)
* ansible-vault show how to decrypt strings * izpelll * Update docs/docsite/rst/vault_guide/vault_encrypting_content.rst Co-authored-by: Don Naro <[email protected]> * Update docs/docsite/rst/vault_guide/vault_encrypting_content.rst Co-authored-by: Don Naro <[email protected]> --------- Co-authored-by: Don Naro <[email protected]>
1 parent dbd98b0 commit 0a84867

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/docsite/rst/vault_guide/vault_encrypting_content.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,25 @@ If you have an encrypted file that you no longer want to keep encrypted, you can
286286
ansible-vault decrypt foo.yml bar.yml baz.yml
287287

288288

289+
.. _decrypting_strings:
290+
291+
Decrypting encrypted strings
292+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
293+
294+
If you just want to check the content of an encrypted string you can also view it by passing it via stdin:
295+
296+
.. code-block:: bash
297+
298+
echo -e '$ANSIBLE_VAULT;1.1;V2\neyJrZXkiOiAiZ0FBQUFBQm5UYzlPUVgzeUc5NFo3R2pzYVNMSXVsdXA3Z0paMmczNVRtS0NqMUcwMTVx\nSU1JVDlJZlRrSXBkVThmLXhKS00xZGl6X3F3YXZmWWUteGJWaHNZZXZNWl9hMWZvLVRYM3ZUZDRvaHRR\nWkhIdkJmZEZWNlBwVjhNVjJFT05QbDFwandaazAiLCAiY2lwaGVydGV4dCI6ICJnQUFBQUFCblRjOU9u\nWmM2dDh2VEN5c3NTQVlyV0hMclNEOFZfSGd2eEVHdERCdkJfakFpcUpaWWNTV19sR2hPY0VsWEVweS0z\nQ0NBcmJfdUdsUEt0NzJuSmFxVVVmRFIzdz09In0=' | ansible-vault decrypt
299+
300+
Alternatively you can use the following command to have Ansible prompt you for input (use Ctrl+D twice to end the input), just like when using ``encrypt_string``:
301+
302+
.. code-block:: bash
303+
304+
ansible-vault decrypt
305+
Reading ciphertext input from stdin
306+
307+
289308
.. _vault_securing_editor:
290309

291310
Steps to secure your editor

0 commit comments

Comments
 (0)