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:
- To allow the Puppet run to complete before the reboot (see also below)
- 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