Match class mappings against entity name incl. subdir
If a node is defined in a subdirectory, then match class mappings
against the entire (relative) path of the node, including its
subdirectory.
For instance, you might have your nodes arranged in subdirectories
according to the datacentre that they are in:
- zurich/host1.example.ch
- zurich/host2.example.ch
- munich/host1.example.de
- munich/host2.example.de
A class mapping such as
/^([^\/]+)\// hosted-in-\\1
would now automatically assign the hosted-in-zurich and hosted-in-munich
classes to the hosts, according to which subdirectory their (yaml_fs)
files reside in.
The information is transported in the so-called entity name, so other
storage backends can also introduce such "tags", they need not be
related to a filesystem path.
Signed-off-by: martin f. krafft <madduck@madduck.net>
4 files changed