Skip to content

Instantly share code, notes, and snippets.

@maxlinc
Created June 27, 2013 16:29
Show Gist options
  • Save maxlinc/5877941 to your computer and use it in GitHub Desktop.
Save maxlinc/5877941 to your computer and use it in GitHub Desktop.
Kwalify (code)
class apps::my_frontend($ensure = 'present', $port = 8080) {
$args = get_scope_args()
$schema = {
'type' => 'map',
'mapping' => {
'ensure' => {
'type' => 'str',
'enum' => ['present', 'absent'],
},
'port' => {
'type' => 'str',
'pattern' => "/^\d\d\d\d$/"
# int and number don't work - maybe puppet hashes don't work very well with kwalify!
# 'range' => {'min' => 1, 'max' => 65535},
}
}
}
kwalify($schema, $args)
# ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment