0Pricing
Ansible Academy · Lesson

Decrypt at Runtime with --ask-vault-pass

Supply the password to a play.

Decrypt at the Right Moment

Vaulted secrets stay encrypted on disk. The trick is feeding Ansible the password exactly when a play needs to read them. 🔑

Prompt for the Password

Add --ask-vault-pass to ansible-playbook and Ansible asks for the vault password once before the run begins.

ansible-playbook site.yml --ask-vault-pass

All lessons in this course

  1. Encrypt a File with ansible-vault create
  2. Edit, View & Rekey Vault Files
  3. Encrypt a Single Variable Inline
  4. Decrypt at Runtime with --ask-vault-pass
← Back to Ansible Academy