The exec resource has an unless parameter too which I think is what you need.
From: http://docs.puppetlabs.com/references/latest/type.html#exec onlyif If this parameter is set, then this exec will only run if the command returns 0 unless If this parameter is set, then this exec will run unless the command returns 0 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.