Skip to content

Instantly share code, notes, and snippets.

@jpadams
Last active December 20, 2015 15:09
Show Gist options
  • Save jpadams/6151870 to your computer and use it in GitHub Desktop.
Save jpadams/6151870 to your computer and use it in GitHub Desktop.
Test of what's a string in Puppet.
$tests = [
"hello",
undef,
44,
"{3 => 4}",
"world!"
]
string_test { $tests: }
define string_test ($test = $title) {
if is_string($test) {
notify{"yes, ${test} is a string.\n":}
} else {
notify {"no, ${test} is NOT a string.\n":}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment