LOGBOOK

HELP

Quiz Entry - updated: 2026.10.30

What does ansible-playbook --syntax-check do, and why run it first?

It parses the playbook and reports YAML and Ansible syntax errors without connecting to any host or running any task.

ansible-playbook --syntax-check playbook-basic/site.yml catches the cheap mistakes before they can do anything: a tab instead of spaces, a mis-indented key, an unknown play keyword, a missing colon. It doesn't contact hosts, so it is fast and safe to run anywhere, including as the first step of a CI pipeline on every commit.

What it does not find: wrong module arguments' values, missing files referenced by src:, unreachable hosts, or tasks that would do the wrong thing. For a dry run against real hosts there is the separate check mode, ansible-playbook --check site.yml, which asks the modules to report what they would change without changing it.

Go deeper:

From Quiz: ITIA / Ansible Inventory, Configuration and Playbooks | Updated: Oct 30, 2026