Hello All, Is there a way to execute an exec prior making a change from a different resource type? For instance: Is there a way that I can do exec { "/code/backup.sh"}, prior to doing file { "/etc/whatever": ensure => present, content => Template["puppet:///whatever"]}. Neither subscribe nor notify will do the trick, as I''d like to execute the script only if there''s a change about to take place, and I want to a backup of the file first. Thanks, -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Answered my own question. Basically you''d need to use: refreshonly => true. Thanks, -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 12/16/2010 11:31 PM, CraftyTech wrote:> Answered my own question. Basically you''d need to use: refreshonly => true.Yes, but have you gotten puppet to do the exec before it updates the resource in question? If so, I''d like to know how you did that ;) Cheers, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
I spoke too quickly... It executes on refresh, but it still does it after the changes, and not before, which kind of defeats the purpose of my backup script... If someone else has a suggestion, I''d happy to hear it.. Thanks, -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Fri, Dec 17, 2010 at 8:20 AM, CraftyTech <hmmedina@gmail.com> wrote:> I spoke too quickly... It executes on refresh, but it still does it after > the changes, and not before, which kind of defeats the purpose of my backup > script... If someone else has a suggestion, I''d happy to hear it.. > Thanks,This doesn''t execute the exec first, but will allow you to backup of the file in a round about way. In the file resource configure backup => ".bak", then notice the exec against the .bak file. Thanks, Nan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Thanks Nan... It really helped out a lot. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.