group nodes by fqdn prefix or value

asked 2018-04-26 14:51:38 -0500

Marc Schöchlin gravatar image

I would like to group some nodes by a common regex citeria using hiera to share options for a group of hosts.

The configuration should act like this:

  1. lookup common.yaml
  2. lookup a definition of regex and corresponding yaml files: group/%{matchname}.yaml
  3. lookup "nodes/%{trusted.certname}.yaml"

The second definition should work like this:

/lb-prod-(de|us)-\d\d\d\ : loadbalancers
/web-prod-(de|us)-\d\d\d\ : webservers

Example: If the {trusted.certname}is, the second yaml file in the hierarchy should be group/loadbalancers.yaml.

Is that possible?

edit retag flag offensive close merge delete

Comments seems to provide a compare solution.

Marc Schöchlin gravatar imageMarc Schöchlin ( 2018-04-26 14:52:06 -0500 )edit