Section 6: Variables, Facts and Templates
Variable precedence and where to define variables
Using facts gathered from target machines to drive decisions
Generating configuration files with Jinja2 templates tailored per machine
Lab: generate a configuration file from a template that adapts to each host
Section 7: Roles and Code Organization
Standard role structure: tasks, handlers, templates, files, vars and defaults
Refactoring long playbooks into reusable roles
Using roles from Ansible Galaxy and assessing their trustworthiness first
Lab: convert your playbook into a role and reuse it
Section 8: Managing Multiple Environments
Separating inventory and variables across dev, staging and production
Using group_vars and host_vars for environment-specific values
Rolling updates so services do not all restart at once
Lab: run the same playbook against two environments with different settings
Section 9: Security and Ansible Vault
Storing passwords and keys safely with Ansible Vault and encrypting variable files
Least-privilege permissions for the account that runs Ansible
Practices for keeping Ansible code in Git without leaking secrets
Lab: encrypt a secrets file with Vault and consume it from a playbook
Section 10: Production Use and Maintenance
Writing genuinely idempotent playbooks and testing before touching production
Structuring an Ansible project so a team can work on it together
Running Ansible from CI/CD and keeping run logs
Using Ansible with Terraform: provision the machine then configure it immediately
Section 11: Capstone and Next Steps
Capstone: write a playbook set that prepares a new server completely for service
Present your role structure and the reasoning behind the design
A first-30-days plan for adopting Ansible in your organization
Workshop: present your playbooks and review the code together