Chapter 4: Managing Variables and Facts
Write playbooks that use variables to simplify management, protect secrets with Ansible Vault, and use facts to reference information about managed hosts.
What you will learn
- Create and reference variables that affect particular hosts or host groups, the play, or the global environment, and describe how variable precedence works.
- Encrypt sensitive variables with Ansible Vault, and run playbooks that reference Vault-encrypted variable files.
- Reference data about managed hosts using Ansible facts, and configure custom facts on managed hosts.
Sections
- Variables in playbooks
- Host and group variables, and precedence
- Exercise: Managing variables
- Protecting secrets with Ansible Vault
- Exercise: Managing secrets
- Ansible facts
- Custom facts and magic variables
- Exercise: Managing facts
- Exercise: Managing variables and facts
- Ansible variables and Vault quiz
- Ansible variables and Vault cheat sheet