syntax check
A quick test that a playbook is valid YAML and valid Ansible structure, without connecting to any host or running anything.
In more detail
Run it with ansible-playbook --syntax-check. It catches misplaced indentation and unknown keywords, but not whether tasks will work, which is what linting and Molecule add.
Related terms
- ansible-playbook — The command that runs a playbook, printing a banner for each play and task, a result per host, and a recap at the end.
- linter — A tool that reads code or configuration without running it and flags likely mistakes and style problems.
- Molecule — A testing framework for Ansible roles that creates a disposable test machine, applies the role, checks the result and destroys the machine.
Taught in
- Testing With Molecule — Ansible Configuration Management at Scale
- Anatomy Of A Playbook: Plays, Tasks And Modules — RHCE in Ansible (EX294): Automate Red Hat Systems
- Variables And Where They Win: group_vars, host_vars And Play Vars — RHCE in Ansible (EX294): Automate Red Hat Systems