On 28 June 2012 01:02, jcbollinger <john.bollin...@stjude.org> wrote: > > > On Tuesday, June 26, 2012 8:12:05 PM UTC-5, Mike Reed wrote: >> >> exec { "purge_linux-image-2.6.32-38-server" : >> command => "/usr/bin/apt-get -y purge >> linux-image-2.6.32-38-server" , >> require => Exec['purge_linux-headers-2.6.32-38'] , >> } >> >> #This is done so the system starts using the new headers/image >> exec { "reboot_after_dist_upgrade" : >> command => "/sbin/reboot" , >> subscribe => Exec["purge_linux-image-2.6.32-38-server"] , >> refreshonly => true , >> } > > > That combination is wrong if you do not in fact intend for Puppet to reboot > the machine on every run. The problem is that > Exec["purge_linux-image-2.6.32-38-server"] runs its command every time, and > any time an Exec runs its command is considered a change (thus triggering > subscribers to refresh). You can avoid that by setting an appropriate > command in the 'onlyif' or 'unless' parameter of that Exec; these plus > 'creates' are how an Exec determines whether it is already in sync.
Much better idea that mine. I was thinking that at the time but got distracted by fixing something urgent. onlyif and creates are very handy for this sort of thing (or creating and ensuring virtual machines are built and running which is what use them for) > John > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/ORPq_sllUnYJ. > > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.