際際滷

際際滷Share a Scribd company logo
Ansible Vault
- Buvanesh Kumar, RHCA
About me
 Works for Red Hat in global learning services team
 Contributor to Fedora, Ezhil language foundation
 IRC - buvanesh_kumar
 Twitter - sbuvaneshkumar
Ansible vault - Introductory session
What is Ansible Vault
 Encrypt sensitive data
 Comes as a part of Ansible
 Allows us to safely store encrypted values
How to encrypt and decrypt?
Encryption:
 Two ways
 vault password file - $ ansible-vault create --vault-password-file=<vault-pass-file>
<playbook>
 Passing the password via STDIN - $ ansible-vault create <playbook>
 While execution
 $ ansible-playbook <playbook> --ask-vault-pass
 $ ansible-playbook --vault-password-file=<vault-pass-file> <playbook>
Decryption:
 $ ansible-vault decrypt <playbook> --ask-vault-pass
 $ ansible-vault decrypt <playbook> --vault-password-file=<vault-pass-file> <playbook>
What can I encrypt?
- Variable files
- Inventory files
- Templates
- Tasks
- Playbooks
- And almost anything ;)
Best practise: Only encrypt sensitive information
Other commands
 $ ansible-vault edit <file>
 $ ansible-vault rekey <file>
 $ ansible-vault view <file>
Demo
Q & A

More Related Content

Ansible vault - Introductory session

  • 2. About me Works for Red Hat in global learning services team Contributor to Fedora, Ezhil language foundation IRC - buvanesh_kumar Twitter - sbuvaneshkumar
  • 4. What is Ansible Vault Encrypt sensitive data Comes as a part of Ansible Allows us to safely store encrypted values
  • 5. How to encrypt and decrypt? Encryption: Two ways vault password file - $ ansible-vault create --vault-password-file=<vault-pass-file> <playbook> Passing the password via STDIN - $ ansible-vault create <playbook> While execution $ ansible-playbook <playbook> --ask-vault-pass $ ansible-playbook --vault-password-file=<vault-pass-file> <playbook> Decryption: $ ansible-vault decrypt <playbook> --ask-vault-pass $ ansible-vault decrypt <playbook> --vault-password-file=<vault-pass-file> <playbook>
  • 6. What can I encrypt? - Variable files - Inventory files - Templates - Tasks - Playbooks - And almost anything ;) Best practise: Only encrypt sensitive information
  • 7. Other commands $ ansible-vault edit <file> $ ansible-vault rekey <file> $ ansible-vault view <file>