localhost has group_vars undefined

In my inventory I have:

[buildserver]
localhost ansible_connection=local

But the playbooks associated with [buildserver] all fail with “undefined” variables; all the group_vars associated with the playbook are seemingly unset for a localhost.

Ansible also seems to be very adroit at figuring out what localhost is … if I use the external IP address instead it works it out and again fails.

Note that buildserver and the matching playbooks all work on an external server with the same OS.

Any thoughts?

Could we see more about your playbook structure?

Sounds like your group_vars/ is not at the right location.

With the later part, I apologize in that I don’t know what “fails” means, so I will need more specifics as to the nature of the beast.