I have a static inventory file similar to
[production:children]
elasticsearch
[elasticsearch]
I have a dynamic inventory file that follows the guidance at
- https://www.jeffgeerling.com/blog/creating-custom-dynamic-inventories-ansible
- https://docs.ansible.com/ansible/intro_dynamic_inventory.html#dynamic-inventory
I have group_vars defined for production.
What I was hoping would happen is that the dynamic inventory would pick up the parent groups and in turn pick up the group vars. This is what happens for static inventories.
That is not the case though, I receive undefined errors for the vars defined in production
- debug: msg="{{ group_names }}"
tags: [always]
but the result is just
TASK [elasticsearch : debug] ***************************************************
task path: /roles/elasticsearch/tasks/main.yml:2
ok: [scrubbed] => {
“msg”: [
“elasticsearch”
]