add_host/group_by how to do sub-groups

11 views
Skip to first unread message

Chris Kiick

unread,
Jul 8, 2020, 4:02:10 PM7/8/20
to Ansible Project
Hi,
I'm exploring the use of add_host instead of a rather convoluted dynamic inventory setup.  I can create the groups for each host, either by specifying groups in add_host, or using group_by. However, these only create flat, first-level groups.  Now I need to have a group hierarchy (group of groups).  Some of the group names are created dynamically, so I can't pre-load the inventory with the group organization.

How can a group of groups be created in the same way as group_by creates groups?
Put another way: how do I add a group to a group inside a playbook?

Thanks,
Reply all
Reply to author
Forward
0 new messages