`{{ proxy_url | default('http://proxy:3128') }}` still renders as an empty string
IntermediateTroubleshootingVariables, Facts and Precedence Problems
Answer
Likely causes → default only fires when the variable is undefined. Here it is defined but empty (proxy_url: "" or null from an AWX survey or a group_vars placeholder).
Fix → Pass true as the second argument, so falsy values also fall back to the default:
"{{ proxy_url | default('http://proxy:3128', true) }}"
Prevent → Do not define placeholder empty values in group_vars. Leave the variable undefined and keep defaults in the role.
More on Variables, Facts and Precedence Problems
Variables in `group_vars/webservers.yml` are silently ignoredBeginnerYou set `nginx_port: 8443` in inventory `group_vars`, but the role still uses `80`Intermediate`set_fact: release_tag=v2` runs, but later tasks still see `v1`Intermediate`'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'` when templating `hostvars['db01']`Intermediate`'ansible_eth0' is undefined` on new cloud instancesBeginnerFacts like `ansible_hostname` became undefined after someone changed `ansible.cfg`Intermediate