How do I pass in a vars_file associated with a specific group/host?

I have the following yml file:

Kill RTS components

It was explained to me by one of my co-workers that “{{ host }}” doesn’t exist and there should probably be a failure prior to executing tasks/realtime_system/kill.yml.

Is there a way I can get the children of realtime_system_components and use that within the vars_files?

“{{ host }}” doesn’t exist, but “{{ inventory_hostname }}” which is the name of the host in the host loop and “{{ ansible_hostname }}” which is the name of the discovered hostname of the the host, does exist.

“Is there a way I can get the children of realtime_system_components and use that within the vars_files”

Sort of. You can see what machines are in any group:

  • debug: var=item
    with_items: groups.webservers

etc