So let's say I have an inventory like this:
[cars]
honda
volvo
saab
[motos]
aprilla
moto-guzzi
and in my playbook I am referring to motorcycles only
- hosts: motos
From what I understand, group_names returns the groups defined in the
inventory. How can I get a list of the host groups I am using in the
playbook?