December 2017
Intermediate to advanced
364 pages
7h 30m
English
This feature is available from Ansible version 2.3. It allows us to use vaulted variables with the !vault tag in YAML files; we will see a simple example and use case for this.
The following playbook is used to perform reverse IP lookups using the ViewDNS API.
We want to secure api_key as it contains sensitive information. We use the ansible-vault encrypt_string command to perform this encryption. Here, we used echo with the -n flag to remove the new line:
$ echo -n '53ff4ad63849e6977cb652763g7b7c64e2fa42a' | ansible-vault encrypt_string --stdin-name 'api_key'

Then we can place the variable, as shown ...
Read now
Unlock full access