On Wednesday, August 29, 2012 6:48:04 AM UTC-5, Sandra Schlichting wrote:
>
> Hi all =)
>
> I would like to purge the following packages
>
> network-manager
>
> network-manager-gnome
>
> network-manager-pptp
>
> network-manager-pptp-gnome
>
>
> but the problem is, that I suppose a reboot is required for the NIC's no 
> longer to be manged by network-manager?
>
>
> How would you work around this?
>
>
Like Krzysztof, I'm not certain that a reboot is required.  On the other 
hand, Network Manager is a tricky and sometimes pesky little beast, so 
maybe a reboot really is required.  I can't advise you on avoiding a 
reboot, but if you really do need one, then you can probably make Puppet 
schedule one using something along these lines:

exec { 'reboot-soon':
  command => '/usr/bin/nohup /sbin/shutdown -r +5 &',
  provider => 'sh',
  subscribe => Package['network-manager'],
  refreshonly => true,
}

That will reboot the system whenever Puppet changes the 'network-manager' 
package (which must already have been declared elsewhere).  The five-minute 
delay designated by the "+5" argument serves two purposes:

   1. To allow the Puppet run to complete before the reboot (see also below)
   2. To give an admin who happens to be logged in a chance to cancel the 
   restart

With respect to the delay time, there is an unavoidable race condition 
here, because you can't really predict how much longer Puppet will take to 
finish up, especially if the system is heavily loaded.  You can largely 
mitigate that, however, by ensuring that Exec['reboot-soon'] is applied 
after all other resources.  Although I'm not a great fan of run stages, 
this looks like a good use case for them.


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/-/ZtpVMqFw7G8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to