Interview Prep/Ansible/YAML, Syntax and Jinja2 Errors

`ERROR! 'tsks' is not a valid attribute for a Play`

BeginnerTroubleshootingYAML, Syntax and Jinja2 Errors
Answer

Likely causes → A typo in a play-level keyword (tsks, handler, var, gather_fact), or a task keyword such as become_pass used at play level.

Diagnose → The error names the bad key. Compare it with the valid play keywords: ansible-doc -t keyword -l.

Fix → Correct the spelling. For example, use tasks, handlers, vars and gather_facts.

Prevent → ansible-lint with schema validation catches these before they reach a run.

All Ansible questions Roadmap: Ansible

More on YAML, Syntax and Jinja2 Errors