Hey All,

I got moved onto another project and I hadn't been able to get back to this 
one until today.  I first wanted to thank you all for the information and 
suggestions.  I'll take a look and see what I can do and I'll be sure to 
let everybody know what the outcome is.  

I like Nan's suggestion about a custom fact but I'm not quite there in my 
knowledge yet so I suspect I'll use some mix of a relation and a simple 
"if" statement.

Cheers,

Mike

On Friday, June 29, 2012 11:29:57 AM UTC-7, Mike Reed 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
>

-- 
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/-/Qf-UpAH1cLcJ.
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