EasyEnv
Ansible
IntermediateLesson 9 of 1225 min · hands-on

Vault and Secrets

Part of the Ansible course

Everything you have written so far has been safe to show anybody. Inventories, templates, role defaults: none of it would hurt you if a stranger read it. Then you reach the task that creates the database user, and it needs a password. You type it into group_vars/db.

Ansible's answer is Vault, a small encryption tool built into the ansible-vault command. It lets a file live in your repository as unreadable ciphertext, and lets Ansible decrypt it in memory at the moment a playbook runs. The file is safe to commit. The passphrase is the one thing you keep out of the repository, and it is one secret instead of fifty. ...

Want to learn Ansible Vault and Secrets in a real environment?

Click below, get a fresh Linux box with Ansible ready to go, and work through Vault and Secrets hands-on with an AI tutor that knows your code.

Start this lessonVault and Secrets

What you'll learn

  • Ansible-vault encrypt
  • Ansible-vault edit
  • Vault password file
  • Encrypted variables
  • Vault id labels

Read this lesson in your language

All lessons in this course

12 lessons
  1. 1What Is Ansible20 min
  2. 2Inventory and Ad Hoc Commands25 min
  3. 3Your First Playbook30 min
  4. 4Tasks, Modules, and Handlers30 min
  5. 5Variables and Facts30 min
  6. 6Templates with Jinja230 min
  7. 7Loops and Conditionals30 min
  8. 8Roles and Galaxy35 min
  9. 9Vault and Secrets25 min
  10. 10Tags and Debugging25 min
  11. 11Collections and Plugins25 min
  12. 12Capstone: Multi Host Deploy60 min

Explore other courses

Vault and Secrets - Ansible (English) | Engineering Courses