Chapter 4: Managing Variables and Facts
Ansible variables and Vault quiz
Twelve questions across variables, precedence, Vault and facts. Aim for at least nine before moving on to chapter 5.
- Which variable name is invalid?
- Which task line is written correctly?
- Which keyword loads play variables from an external file?
- Put these in order, lowest precedence first: play vars, group_vars file, extra vars, host_vars file.
- Where should group variables for `webservers` go, following recommended practice?
- Which two expressions return the same value?
- What does `register: result` store?
- Which command encrypts two files that already exist?
- How do you run a playbook with a Vault password stored in `vault-pass`?
- Which variable holds a host’s total memory in MiB?
- A custom fact file must be…
- The inventory lists a host as `web1 ansible_host=servera.lab.example.com`. What is `inventory_hostname`?