This is a simple Puppet ENC (External Node Classifier) that classifies nodes based on regular expressions read from a YAML file.
The configuration file is a YAML dictionary where each key represents a host regular expression. If no match is found, attributes from the (optional) host DEFAULT is returned.
The following attributes are allowed by Puppet:
- environment
- classes
- parameters
At least environment or classes must be defined.
DEFAULT:
classes: []
'^foo-dev-bar\d+\..+$':
environment: develop
parameters: { guild: foo-dev }
classes: [ 'roles::foo::bar' ]
'^foo-prod-bar\d+\..+$':
environment: production
parameters: { guild: foo-prod }
classes: [ 'roles::foo::bar' ]