Supragroups in Ansible Inventory File

From bib. source

The […] block tells ansible to define a new group ‘multi’, with child groups, […]

And the block being referred to is an example as follows (Geerling 2023, 22):

# Group 'multi' with all servers
[multi:children]
app
db

Wherein app and db are themselves also groups, making multi a grouping of groups (Ibid):

[app]
192.168.56.4
192.168.56.6
 
[db]
192.168.56.6

And these groups of servers are for the ansible inventory file, thereby needing to follow the INI configuration file syntax.

What’s important to note about the example block for creating a supragroup, or a group containing subgroups, is that it does so by appending :children at the end of the group name assigned to that section of the INI file, in-between the square brackets.

Ansible inventory_file configuration_management IP_address Internet_Protocol_address set_theory square_brackets configuration_file server graph_theory


bibliography

  • “Ad-Hoc Commands.” In Ansible for DevOps: Server and Configuration Management for Humans, 2nd ed., 18–46. Leanpub, 2023.