Hi,
I am trying to develop custom inventory plugin.
And I wonder if its possible to access vars defined in host_vars and group_vars from parse method of this plugin.
All i can get are vars ‘inventory_file’, ‘inventory_dir’ and nothing like vars from host_vars files.
I am using
ansible 2.8.1
config file = /home/artgromov/arcadia/logbroker/juggler/ansible-juggler/ansible.cfg
configured module search path = [u’/home/artgromov/arcadia/logbroker/juggler/ansible-juggler/plugins/library’]
ansible python module location = /home/artgromov/.local/share/virtualenvs/ansible-juggler-GeUFfaTC/lib/python2.7/site-packages/ansible
executable location = /home/artgromov/.local/share/virtualenvs/ansible-juggler-GeUFfaTC/bin/ansible
python version = 2.7.15 (default, Oct 15 2018, 15:26:09) [GCC 8.2.1 20180801 (Red Hat 8.2.1-2)]
system
(system)
November 11, 2019, 9:39pm
3
You have access to host and group vars defined by previous inventory
sources, but the host_vars/group_vars files are not available, since
those are processed after all inventory is defined.
You could call the vars plugins directly but it is not something I advise.