----- Mike Reed <mjohn.r...@gmail.com> wrote:
> Hello all,
> 
> I'd like to use puppet to install an Nvidia driver on a local workstation. 
>  I've written the following manifest for this puprpose:
> 
> class nvidia_driver {
>         # This will place the nvidia installer locally in /tmp.  File is 
> pulled from puppet.
>         file { "/tmp/NVIDIA-Linux-x86_64-295.53.run" :
>                 source  => 
> "puppet:///modules/nvidia_driver/NVIDIA-Linux-x86_64-295.53.run" ,
>                 ensure  => present ,
>         }
> 
>         # This will run the nvidia installer locally on the machine.  
>         exec { "/tmp/NVIDIA-Linux-x86_64-295.53.run -s -X --opengl-headers 
> --no-distro-scripts --force-tls-compat32=new" :  }
>              
> }
> 
> Upon the initial run of the manifest on the target machine, everything 
> works great (although I do believe there is some room for improvement of 
> the code above; particularly on the exec portion) and the driver then gets 
> installed.  The issue occurs on subsequent puppet runs on the same machine 
> and I'm getting the following error during my second puppet run from the 
> client:
> 
> err: /Stage[main]/Nvidia_driver/Exec[/tmp/NVIDIA-Linux-x86_64-295.53.run -s 
> -X --opengl-headers --no-distro-scripts --force-tls-compat32=new]/returns: 
> change from notrun to 0 failed: /tmp/NVIDIA-Linux-x86_64-295.53.run -s -X 
> --opengl-headers --no-distro-scripts --force-tls-compat32=new returned 1 
> instead of one of [0] at 
> /etc/puppet/modules/nvidia_driver/manifests/init.pp:12
> 
> It appears to me that the above error is occurring because the 
> nvidia_driver class is running on each subsequent run and since the driver 
> is already installed, I'm getting an exit status of 1 instead of 0, which 
> to my knowledge would be expected.  
> 
> So, what I'd like to do is put some sort of condition that will look to see 
> if the driver is installed and if it is, the class "nvidia_driver" won't 
> run.  I'm having a hard time figuring this one out and I was hoping to get 
> a few opinions on how this might be accomplished.  
> 
> Would this potentially be a job for a shell script that does the checking? 
>  Maybe just adding the shell script into the "nvidia_driver" manifest?  
> 
> Thanks in advance for everybody's assistance and the help is very much 
> appreciated.
> 
> Cheers,
> 
> Mike

I am working with the same kind of drivers and I have a suggestion:

The driver only needs to be re-installed when the kernel changes version.

I am not sure how to implement this idea, but it is something to check against.
If I have any revelations, I will post here.

“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)

-- 
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