You set `nginx_port: 8443` in inventory `group_vars`, but the role still uses `80`
IntermediateTroubleshootingVariables, Facts and Precedence Problems
Answer
Likely causes → The role defines nginx_port in roles/nginx/vars/main.yml. Role vars/ are higher in precedence than inventory group_vars and host_vars. Only defaults/main.yml is lower.
Diagnose →
grep -rn 'nginx_port' roles/nginx/
Fix → Move tunable values to roles/nginx/defaults/main.yml. Keep vars/main.yml for internal constants that callers must never change, such as package names per OS.
Prevent → Use this convention in code review: anything a user may override goes in defaults/, prefixed with the role name.
More on Variables, Facts and Precedence Problems
Variables in `group_vars/webservers.yml` are silently ignoredBeginner`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`web01` is in both `prod` and `eu` groups, and `ntp_server` has a different value on every run you checkAdvanced