You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think because this inventory plugin is based upon ansible.builtin.constructed which doesn't provide your feature...maybe it wouldn't be added? Maybe you can request your feature idea in the core Ansible project? Then all other projects' inventory plugins based on constructed would be able to take advantage?
I think the idea is that you use group_vars for supplying group variables. e.g. if you use the sample webservers dynamic group from the constructed documentation:
plugin: ansible.builtin.constructedstrict: Falsecompose:
var_sum: var1 + var2# this variable will only be set if I have a persistent fact cache enabled (and have non expired facts)# `strict: False` will skip this instead of producing an error if it is missing facts.server_type: "ansible_hostname | regex_replace ('(.{6})(.{2}).*', '\\2')"groups:
# simple name matchingwebservers: inventory_hostname.startswith('web')
you can then have the vars file in group_vars/webservers.yml:
SUMMARY
It would be very handy to have possibility to add not only host variables but also group variables. Is this feature planned?
ISSUE TYPE
COMPONENT NAME
Now inventory module.
ADDITIONAL INFORMATION
N/A
The text was updated successfully, but these errors were encountered: