Interview Prep/Ansible/Variables, Facts and Templates

You have to merge two dictionaries, with one overriding the other, such as defaults plus per-site settings.

IntermediateScenarioVariables, Facts and Templates
Answer

Situation read → Deep merge of structured data.

What I'd do →

app_config: "{{ app_defaults | combine(app_overrides, recursive=True) }}"

Why → combine merges dicts; without recursive=True nested keys are replaced wholesale.

Interview tip → For lists use + or union, and unique to dedupe.

All Ansible questions Roadmap: Ansible

More on Variables, Facts and Templates