Hi John

That is a very interesting solution!

I had to look up what "provider" and "refreshonly" did. They seam to be 
very useful for other situations as well!

Thanks =)

Hugs,
Sandra


On Wednesday, 29 August 2012 16:04:32 UTC+2, jcbollinger wrote:
>
>
>
> 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/-/sd-y4s4qZ5MJ.
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