Ansible Vault is an exciting feature of Ansible that was introduced in Ansible Version 1.5. This allows you to have encrypted passwords as part of your source code. A recommended practice is to not have passwords (as well as any other sensitive information such as private keys and SSL certificates) in plaintext as part of your repository, because anyone who checks out your repository can view your passwords. Ansible Vault can help you to secure your confidential information by encrypting and decrypting them on your behalf.
Ansible Vault supports an interactive mode in which it will ask you for the password or a non-interactive mode where you will have to specify the file containing the password and Ansible Vault will read it directly.
For these examples, we will use the password ansible, so let's start creating a hidden file called .password with the ansible...