Confirmed... defaulting the parameter to the bareword 'undef' does the 
trick.  Thanks again for the assist.

-Mark

On Thursday, May 29, 2014 10:32:10 AM UTC-5, Mark McFate wrote:
>
> Ah, I misunderstood and didn't realize that Puppet's 'undef' bareword is 
> effectively equivalent to a Ruby 'nil'.  Thanks for the follow-up!  I'm not 
> all the way there yet, but yes, I believe this approach is working.  Thanks.
>
> Just to be clear, I added a parameter definition to the module so that it 
> now reads...
>
> define drush::exec(
>   $command        = $title,
>   $creates           = undef,
> ) 
>
>
> -Mark
>
> On Thursday, May 29, 2014 10:21:41 AM UTC-5, Jose Luis Ledesma wrote:
>>
>> Have you tried to set it to undef?
>> El 29/05/2014 17:13, "Mark McFate" <summitt...@gmail.com> escribió:
>>
>>> And thank you Joes Luis, but I'm also unable to make this work.  It 
>>> seems the $creates parameter must be declared in my module and when left 
>>> with a blank or nil value Puppet kicks back this error:
>>>
>>> Error: Parameter creates failed on Exec[drush-drush-download-modules]: 
>>> creates must be a fully qualified path at 
>>> /tmp/vagrant-puppet-1/modules-0/drush/manifests/exec.pp:68
>>>   
>>> -Mark
>>>
>>> On Thursday, May 29, 2014 9:47:55 AM UTC-5, Jose Luis Ledesma wrote:
>>>>
>>>> I have not tried with the creates param, but if its undef ( I.e. no one 
>>>> have set it) you can use it directly
>>>>
>>>> exec { "drush-${title}" :
>>>>
>>>>       command => "drush ${command} ${root_option} ${uri_option} 
>>>> ${force_option} ${additional_options}",
>>>>
>>>>       path    => [ '/bin', '/usr/bin' ],
>>>>
>>>>       creates => $creates, 
>>>>
>>>>     }
>>>>
>>>> If it's undef, this should work like not specifying it.
>>>>
>>>> Regards,
>>>> El 29/05/2014 16:34, "Mark McFate" <summitt...@gmail.com> escribió:
>>>>
>>>>> I'm probably going about this all wrong, but I have an instance where 
>>>>> I've employed a Puppet module and need to *sometimes* add a "creates" 
>>>>> attribute to one of the exec's defined there.  My code (below) is 
>>>>> probably 
>>>>> all wrong, but I think you'll see what I am trying to do...
>>>>>
>>>>>   if $creates != nil {
>>>>>     exec { "drush-${title}" :
>>>>>       command => "drush ${command} ${root_option} ${uri_option} 
>>>>> ${force_option} ${additional_options}",
>>>>>       path    => [ '/bin', '/usr/bin' ],
>>>>>       creates => $creates, 
>>>>>     }
>>>>>   } else {
>>>>>     exec { "drush-${title}" :
>>>>>       command => "drush ${command} ${root_option} ${uri_option} 
>>>>> ${force_option} ${additional_options}",
>>>>>       path    => [ '/bin', '/usr/bin' ],
>>>>>     }
>>>>>   }
>>>>>
>>>>>  
>>>>> This doesn't work and neither does specifying an empty or nil 
>>>>> attribute, like "creates => ''" or "creates => nil".  
>>>>>
>>>>> If nothing else, I will create two different exec's, one with and the 
>>>>> other without a creates attribute.  Can anyone suggest a more elegant 
>>>>> solution?
>>>>>
>>>>> Thanks in advance.
>>>>>  
>>>>> -- 
>>>>> 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...@googlegroups.com.
>>>>> To view this discussion on the web visit https://groups.google.com/d/
>>>>> msgid/puppet-users/753daff9-b848-40b9-bca8-1328c313c870%
>>>>> 40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/753daff9-b848-40b9-bca8-1328c313c870%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>  -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/puppet-users/dcb1d2de-5e97-4650-9c30-50525eae9b6e%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/dcb1d2de-5e97-4650-9c30-50525eae9b6e%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
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/2ea06ad1-56c0-4487-ac75-6a9daf607e32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to