]> git.ipfire.org Git - thirdparty/systemd.git/commit
machine-tags: optionally support key/value pairs as machine tags
authorLennart Poettering <lennart@amutable.com>
Tue, 16 Jun 2026 13:53:56 +0000 (15:53 +0200)
committerLennart Poettering <lennart@amutable.com>
Fri, 19 Jun 2026 21:05:36 +0000 (23:05 +0200)
commit9afeae5e8a8fd5deb75ea6e861e2fe02b247deb9
treeed418d198228e6911fed8e4f2e52b61d9f841863
parent4552dce3b5ce6e1b3a246dba75b975fb7d88d317
machine-tags: optionally support key/value pairs as machine tags

Other systems (kubernetes…) allow tagging machines with key/value pairs.
Let's extend our allowed syntax slightly to allow that too. Thankfully,
we enforced a pretty strict ruleset on machine tags, hence we can
introduce this without breaking compatibility.

This basically allows tags to contain "=". If so, then the left-hand
side of it must be unique among machine tags.

When matching against a machine tag, we apply the same rules as before.
This means, that if people want to check if a tag with value applies
they can do:

    ConditionMachineTag=foo=bar

If they just want to check if "foo=" is set to anything, they can use
the usual glob matching:

    ConditionMachineTag=foo=*
man/hostnamectl.xml
man/machine-info.xml
man/systemd.unit.xml
src/basic/hostname-util.c