Skip to content

unvault

Collection Note

This module is part of the ansible.builtin collection. To install the collection, use:

ansible-galaxy collection install ansible.builtin
Added in version 2.12.

Synopsis

  • Retrieve your information from an encrypted Ansible Vault.

Parameters

Parameter Defaults / Choices Comments
_input
string
required
Vault string, or an C(AnsibleVaultEncryptedUnicode) string object.
secret
string
required
Vault secret, the key that lets you open the vault.
vault_id
string
Default: filter_default
Secret identifier, used internally to try to best match a secret when multiple are provided.

Examples

# simply decrypt my key from a vault
vars:
  mykey: "{{ myvaultedkey | unvault(passphrase) }} "

- name: save templated unvaulted data
  template: src=dump_template_data.j2 dest=/some/key/clear.txt
  vars:
    template_data: '{{ secretdata | unvault(vaultsecret) }}'

Return Values

Key Data Type Description Returned
_value string The string that was contained in the vault.

Authors

  • Brian Coca (@bcoca)