Hello Thomas,

Thank you for your comments and thoughts.  I'm still trying to understand 
basic programming and I see now that I'm mixing things up.  

I also wanted to thank you for taking the time to put the code up on gist, 
in order to give me a clear example of what you are talking about.  I very 
much appreciate it.

Cheers,

Mike

On Friday, January 22, 2016 at 1:11:38 AM UTC-8, Thomas Müller wrote:
>
> Hi Mike
>
> Am Donnerstag, 21. Januar 2016 23:20:38 UTC+1 schrieb Mike Reed:
>>
>> ... check the values by running a facter -p, which results in something 
>> like:
>>
>> nvidia_installed => false
>> video_card_id => 17c2
>> class => workstation
>>
>  
> ...
>  
>
>>
>>   if ($::is_virtual == true) and ($::class == 'server') {
>>     notify { 'This is a virtual machine and the nvidia driver doesn\'t 
>> get intalled' : 
>>   }
>>     # only run nvidia installer if the machine is a workstation and the 
>> driver is not already installed
>>   } elsif ($::class == 'workstation') and ($::nvidia_installed == 
>> 'false') {
>>
>  
>
>>       if ($::video_card_id == $model_hash[key]) {
>>
>
> What is key? key is a bare word not a variable. Maybe you meant "if 
> (!empty($model_hash[$::video_card_id])" ?
>
> https://gist.github.com/vinzent/5e5f187a8d1dcb000f8a/revisions
>  
>
>>         notify { "Installing driver for ($model_hash[key])" : }
>>         exec { 'kdm-stop' :
>>
> .... 
>
>> Also, as a bonus question, if I wanted to use this code in another 
>> module, is it as simple as "include ::nvidia::driver_install"?
>>
>
> it should be as easy as that.
>
> I do see some problems with the exec reboot. It will initiate the reboot 
> while puppet is applying changes. this might produce unexpected results.
>
> - Thomas
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8e5fe5e2-722b-4c8a-be3c-5d7e0ae7aee0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to