Set host tags based on host labels (for "Virtual Host Tree")

Our hosts emit lables like :

  • stage (dev, integ, prod) and
  • owner (teamA, teamB, teamC, …) and
  • role (webserver, cache, database, …)

Now I want to use the “Virtual Host Tree” to build a tree by-team, by-stage, by-role to make it possible for our teams to e.g. select "all of teamA’s prod webservers "

But the “tree levels” of “Virtual Host Tree” can only be configured by using host tags.
Host labels are not possible for “Virtual Host Trees”.

So I came up with the idea to set host tags based on host labels.

E.g. a host with label stage:prod should get the tag stage with value prod.

But I can’t find a rule that makes this possible.

Any hints ?

Thanks in advance.

Hm, I still looking how to set host_tags based on host_labels
because there are some rules like the one for setting “Service labels”
where the condition can only be a host_tag but not a host_label.