A Jinja expression builds a path from several variables and sometimes yields a double slash.
BeginnerScenarioVariables, Facts and Templates
Answer
Situation read → String concatenation sloppiness.
What I'd do →
dest: "{{ base_dir | trim('/') }}/{{ app }}"
dest2: "{{ [base_dir, app] | join('/') | regex_replace('/+', '/') }}"
dest3: "{{ (base_dir ~ '/' ~ app) | path_join }}"
Why → path_join (Ansible 2.10+) normalises separators; plain concatenation does not.
Interview tip → Use ~ for string concatenation; + can fail on mixed types.
More on Variables, Facts and Templates
A variable you set in `group_vars` is being overridden and you do not know where. How do you find the source?IntermediateYou need different values per environment without copying playbooks.BeginnerYou must render an Nginx config with one `server` block per site from a list.IntermediateA template needs the IPs of all hosts in the `db` group, for example for a replication config.IntermediateNothing should be rendered unless a mandatory variable is supplied.BeginnerPer-host values, like `server_id` for MySQL, must be unique and stable.Intermediate