# Ansible Vault

In 
Published 2022-12-03

This tutorial explains to you how to use Ansible vault.

In Ansible inventory you keep the password for ssh authentication. This is not good in production environment.

For be security compliant, you need to encrypt the inventory file into an Ansible vault and this vault will be protected with a password.

Take a look at the picture below:

You can see that after the command ansible-vault encrypt inventory.txt the inventory is encrypted.

If you try to run the playbook in a same manner as before an error will appear:

In order to run the playbook, you need to add to the command --ask-vault-pass option (you will be asked for the vault password):

In order to make this automation more secure and in order not to input the password manually, you can use a Python script to find the password in a database, etc.