Hi Mike,

Just as a side not I would be rather hesitant to set this up with puppet.
This may be a job for some other tool like mcollective but I have not
ventured into the land yet.

This may work but I haven't done any testing so please test this on a
non production server before rolling it out.

I would try a notify in your exec {
"purge_linux-image-2.6.32-38-server" : resource and take the subscribe
out of the reboot.

Something like this.

        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'] ,
                notify   => Exec["reboot_after_dist_upgrade"]
        }
        #This is done so the system starts using the new headers/image
        exec { "reboot_after_dist_upgrade" :
                command => "/sbin/reboot" ,
                refreshonly => true ,
        }


On 27 June 2012 11:12, Mike Reed <mjohn.r...@gmail.com> wrote:
> Hello all,
>
> In building out an initial workstation configuration (Ubuntu 10.04 lucid)
> via Puppet, I have the need to do two things in order.  The first is to do a
> dist-upgrade on the workstation and reboot, followed by an install of a
> Nvida driver.  Upon doing a dist-upgrade, I have to reboot the machine in
> order for the workstation to start using the new linux-headers because if I
> install the Nvidia drivers without doing a reboot after a dist-upgrade, the
> drivers will compile against the old headers and my gui no longer works and
> X won't start because of a modprobe issue.
>
> With that said, I've written the dist-upgrade manifest as so:
>
> class dist_upgrade {
>         exec { "dist_upgrade" :
>                 command => "/usr/bin/apt-get -y dist-upgrade" ,
>         }
>
>         exec { "purge_linux-headers-2.6.32-38" :
>                 command => "/usr/bin/apt-get -y purge
> linux-headers-2.6.32-38" ,
>                 require => Exec['dist_upgrade'] ,
>         }
>
>         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 ,
>         }
> }
>
> This seems to be doing the job but I feel it's a bit of a hack and I was
> wondering if anybody had an opinion as to if this can be done in a cleaner
> fashion.  I'm still very new to Puppet so please excuse my novice example.
>
> Thanks in advance for the help and support.
>
> Cheers,
>
> Mike
>
> --
> 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/-/R5BQkgRvyt4J.
> 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.

Reply via email to