Skip to content

Commit

Permalink
ansible-vault show how to decrypt strings (#2238) (#2273)
Browse files Browse the repository at this point in the history
* 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]>
(cherry picked from commit 0a84867)

Co-authored-by: Brian Coca <[email protected]>
  • Loading branch information
patchback[bot] and bcoca authored Dec 10, 2024
1 parent b3a7352 commit b6c17e3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/docsite/rst/vault_guide/vault_encrypting_content.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b6c17e3

Please sign in to comment.