December 2017
Intermediate to advanced
364 pages
7h 30m
English
The following examples demonstrate how we can use secrets in our playbook variable files.
Let's take an example of installing MySQL server in an Ubuntu operating system using the following playbook. As per the Ansible documentation, it's easy and better to store Vault variables and normal variables differently.
The following code snippet is the high-level file structure for installing MySQL server with the root password:
├── group_vars│ └── mysql.yml # contains vault secret values├── hosts├── main.yml└── roles └── mysqlsetup └── tasks └── main.yml
Now we can see that the mysqlsetup role contains the following tasks that require the mysql_root_password variable, which contains the root password ...