Ansible Vault

In Ansible, it is possible to load in variables from files. We will be looking at this in our next chapter in more detail. These files can contain sensitive information such as password and API keys. An example of this would be the following:

secret: "mypassword"secret-api-key: "myprivateapikey" 

As you can see, we have two sensitive bits of information visible as plaintext. This is OK while the file is on our local machine, but what if we want to check the file into source control to share it with our colleagues? Even if the repository is private, we shouldn't be storing this type of information in plaintext.

Ansible introduced Vault to help solve this very problem. Using Vault, we can encrypt the file and then when, Ansible ...

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.