How to use variables defined in inventory file (hosts) in my playbook?

Hi,

As the subject says. Here is an example. Based on all my research I was expecting foo and bar to be part of hostvars. I can put host specific variables in separate var files, but I would love to keep them in my inventory file. I don’t want to use it in a template.

bash $
bash $ cat test_inv.ini

[foobar]
someHost foo=“some string” bar=123
someOtherHost foo=“some other string” bar=456

bash $
bash $ cat test.yml