| As a complement to onlyif and unless, sometimes the command itself is the best positioned to decide if a change needs to be made. It would be nice if there was an attribute to the Exec resource type that allowed to command to inform puppet that no changes were made. If, for example, I had:
exec {'stuff': |
command => '/usr/local/bin/foo', |
unchanged => '42', |
notify => Service['bar'] |
} |
If /usr/local/bin/foo exited with code 42, the exec would show up as unchanged (instead of as a failure) in the puppet results and would NOT trigger the notify. |