`ERROR! Invalid extra vars data supplied. 'vars/prod.yml' could not be made into a dictionary`
BeginnerTroubleshootingVariables, Facts and Precedence Problems
Answer
Likely causes → The file path was passed without @. -e vars/prod.yml is read as an inline string, not as a file.
Fix →
ansible-playbook site.yml -e @vars/prod.yml
Also check that the file's top level is a mapping, not a list.
Prevent → Wrap the call in a Makefile or CI template so the flags stay consistent.
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