Skip to content

Instantly share code, notes, and snippets.

@purplexa
Last active April 24, 2017 18:11
Show Gist options
  • Save purplexa/2403a493a291ce94c8c8834ab5dba3c0 to your computer and use it in GitHub Desktop.
Save purplexa/2403a493a291ce94c8c8834ab5dba3c0 to your computer and use it in GitHub Desktop.
puppet before/notify/refreshonly behavior
file { '/tmp/before_test':
ensure => present,
before => Exec['/bin/rm /tmp/before_test'],
}
exec { '/bin/rm /tmp/before_test':
refreshonly => true,
}
file { '/tmp/notify_test':
ensure => present,
notify => Exec['/bin/rm /tmp/notify_test'],
}
exec { '/bin/rm /tmp/notify_test':
refreshonly => true,
}
> puppet apply before_refreshonly.pp
Notice: Compiled catalog for node in environment production in 0.13 seconds
Notice: /Stage[main]/Main/File[/tmp/before_test]/ensure: created
Notice: /Stage[main]/Main/File[/tmp/notify_test]/ensure: created
Notice: /Stage[main]/Main/Exec[/bin/rm /tmp/notify_test]: Triggered 'refresh' from 1 events
Notice: Applied catalog in 0.08 seconds
> puppet apply before_refreshonly.pp
Notice: Compiled catalog for node in environment production in 0.12 seconds
Notice: /Stage[main]/Main/File[/tmp/notify_test]/ensure: created
Notice: /Stage[main]/Main/Exec[/bin/rm /tmp/notify_test]: Triggered 'refresh' from 1 events
Notice: Applied catalog in 0.07 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment