Skip to content

Instantly share code, notes, and snippets.

@richardc
Created February 6, 2013 19:40
Show Gist options
  • Save richardc/4725160 to your computer and use it in GitHub Desktop.
Save richardc/4725160 to your computer and use it in GitHub Desktop.
#!/bin/sh
rm /tmp/hosts.cfg
puppet apply -e 'nagios_host { "foo": target => "/tmp/hosts.cfg", check_command => "a_mistake" }'
grep check_command /tmp/hosts.cfg
# Not what we want - the resource doesn't change as undef doesn't make it
# through to the type to clear the value
puppet apply -e 'nagios_host { "foo": target => "/tmp/hosts.cfg", check_command => undef }'
grep check_command /tmp/hosts.cfg
# Not what we want - absent setting to a value
puppet apply -e 'nagios_host { "foo": target => "/tmp/hosts.cfg", check_command => "absent" }'
grep check_command /tmp/hosts.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment