Make `groups` work as they were designed to
Containerlab topology definition file had a notion of a group forever. But we never implemented them in the way they were envisioned to be used.
A group should allow a user to define a common set of node-level parameters that a certain node can then inherit via the group reference.
For example, the below topology defines a group leafs and adds some node-specific parameters to it. Then a node in the topology references this group to adopt the specified parameters:
name: group-demo
topology:
groups:
leafs:
labels:
someLabel: someValue
type: ixrd3l
nodes:
node1:
group: leafs
node2:
node1 will inherit labels and type as defined in a group, whereas node2 will not.
I'm just starting with container lab. I think rather than having groups defined in one place and then tag the nodes as part of the groups, why not have groups be subsets of nodes. This could also allow for multiple layers of inheritance and maybe even groups in groups. Kind of like how Ansible handles yaml inventories
name: groups-demo
topology:
# General nodes
nodes:
node1:
kind: linux
# Grouped nodes
groups:
lab1:
kind: ceos
labels:
cloud: az
nodes:
lab1a:
lab2:
kind: nokia_srlinux
groups:
clients:
nodes:
lab2a:
lab2b:
spine:
nodes:
spine1:
type: ixrd31