Interview Prep/Ansible/YAML, Syntax and Jinja2 Errors

`We could be wrong, but this one looks like it might be an issue with missing quotes. Always quote template expression brackets when they start a value.`

BeginnerTroubleshootingYAML, Syntax and Jinja2 Errors
Answer

Likely causes → A value starts with {{. YAML reads { as the start of an inline dictionary.

dest: {{ app_dir }}/config.yml     # broken

Fix →

dest: "{{ app_dir }}/config.yml"

Prevent → The rule is simple: if a value starts with {{, wrap the whole value in quotes. ansible-lint and yamllint both catch this.

All Ansible questions Roadmap: Ansible

More on YAML, Syntax and Jinja2 Errors