Running an ansible playbook on localhost but referring to inventory's group_var

So, theoretically adding localhost in the inventory would have been a good solution, but in my specific case (and in general for large deployments) was not an option.

I also added --extra-vars "myvar.json" but did not work either.

Turns out (evil detail...) that the right way to add a var file via command line is: --extra-vars "@myvar.json"

Posting it here in hope nobody else struggle days to find this solution.

Cheers, dom

Tags:

Ansible