How are group_vars merged?

Hi all,

I try to understand how group_vars are merged:

all:
  children:

    ...
    dmz5_jails:
      hosts:
        ...
        ns5:
        ...

    ...
    dmz5_hosts:
      children:
        ...
        dmz5_jails:

    all_jails:
      children:
        ...
        dmz5_jails:

    ns:
      hosts:
        ns5:

lr_ns_public_zones: [
   ...
]

A playbook:

Hi,

Perhaps here is what you're looking for...

https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#how-variables-are-merged

There's a parameter available to change the default behaviour

Regards,

JYL

Hi,

Perhaps here is what you’re looking for…

I have variable ns defined only in inventory/group_vars/ns.yaml, but it is not used at all.
So something must be wrong with my inventory.

Is ns5 not in group ns?

Or is something wrong with the playboo?
Does it matter that it uses group ns and nor host ns5?

  • hosts: ns

Thank you for answering,
Axel