From 25041e535d9920263410a6d702a393a29bfbf34d Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 11:50:11 +0000 Subject: [PATCH] ansible-vault show how to decrypt strings (#2238) (#2272) * ansible-vault show how to decrypt strings * izpelll * Update docs/docsite/rst/vault_guide/vault_encrypting_content.rst Co-authored-by: Don Naro * Update docs/docsite/rst/vault_guide/vault_encrypting_content.rst Co-authored-by: Don Naro --------- Co-authored-by: Don Naro (cherry picked from commit 0a84867064efc7453a37aecf86361514e7d7efe4) Co-authored-by: Brian Coca --- .../vault_guide/vault_encrypting_content.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/docsite/rst/vault_guide/vault_encrypting_content.rst b/docs/docsite/rst/vault_guide/vault_encrypting_content.rst index 5c46309c81a..6b0d7899400 100644 --- a/docs/docsite/rst/vault_guide/vault_encrypting_content.rst +++ b/docs/docsite/rst/vault_guide/vault_encrypting_content.rst @@ -286,6 +286,25 @@ If you have an encrypted file that you no longer want to keep encrypted, you can ansible-vault decrypt foo.yml bar.yml baz.yml +.. _decrypting_strings: + +Decrypting encrypted strings +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you just want to check the content of an encrypted string you can also view it by passing it via stdin: + +.. code-block:: bash + + echo -e '$ANSIBLE_VAULT;1.1;V2\neyJrZXkiOiAiZ0FBQUFBQm5UYzlPUVgzeUc5NFo3R2pzYVNMSXVsdXA3Z0paMmczNVRtS0NqMUcwMTVx\nSU1JVDlJZlRrSXBkVThmLXhKS00xZGl6X3F3YXZmWWUteGJWaHNZZXZNWl9hMWZvLVRYM3ZUZDRvaHRR\nWkhIdkJmZEZWNlBwVjhNVjJFT05QbDFwandaazAiLCAiY2lwaGVydGV4dCI6ICJnQUFBQUFCblRjOU9u\nWmM2dDh2VEN5c3NTQVlyV0hMclNEOFZfSGd2eEVHdERCdkJfakFpcUpaWWNTV19sR2hPY0VsWEVweS0z\nQ0NBcmJfdUdsUEt0NzJuSmFxVVVmRFIzdz09In0=' | ansible-vault decrypt + +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``: + +.. code-block:: bash + + ansible-vault decrypt + Reading ciphertext input from stdin + + .. _vault_securing_editor: Steps to secure your editor