Hi John,

I provided the complete code which contains the rm_hosts in my original 
post; see role/wh/hadoop.pp . I tried your suggestion but I was getting 
errors in the role/wh/hadoop.pp file. Do you believe your code will work in 
the role/wh/hadoop.pp above? If so can you be a little more explicit and 
show me what you mean? I am still trying to solve the problem.

Thanks,

Colin

On Friday, September 5, 2014 8:45:07 PM UTC, jcbollinger wrote:
>
>
>
> On Friday, September 5, 2014 1:37:21 PM UTC-5, Colin Kincaid Williams 
> wrote:
>>
>> I'm going to try your suggestion. Thanks for the response! I'm curious 
>> however if $rm_hosts is available where you suggest. 
>>
>
>
> I made no suggestion about where $rm_hosts is available in your code.  You 
> were proposing to use it in some scope where apparently you were confident 
> it was available, and I gave you a way you could use it in that scope to 
> achieve what you appeared to be trying to do.  I relied on your evaluation 
> of its availability.
>
> Inasmuch as you raise the question, however, you should note that resource 
> declarations do not establish scopes, and moreover that parameter bindings 
> in resource declarations do not add *anything* to the scope in which the 
> declaration appears.  The parameter bindings in a given parameter list are 
> not available elsewhere in that list nor in the surrounding scope -- they 
> are available only in the body of the declared resource.
>
>  
>
>> E.G.
>>
>> class role::wh::hadoop::production {
>>           $is_rm = $::hostname in $rm_hosts
>>
>>
>> When the relevant lines from the provided hadoop.pp pasted above :
>>
>> class role::wh::hadoop::production {
>>   
>>     class { 'cdh5::hadoop':
>>         namenode_hosts                           => [
>>         'us3sm2nn010r07.comp.prod.local',
>>         'us3sm2nn011r08.comp.prod.local',
>>     ],
>>     rm_hosts                                 => [
>>                                                         
>> 'us3sm2nn010r07.comp.prod.local',
>>                                                         
>> 'us3sm2nn011r08.comp.prod.local',
>>                                                     ],
>>
>>
>>
>
> You would probably want to pull the value being bound to class parameter 
> cdh5::hadoop::rm_hosts out to a local variable in the role class:
>
> $rm_hosts = [
>   'us3sm2nn010r07.comp.prod.local',
>   'us3sm2nn011r08.comp.prod.local',
> ]
>
> $is_rm = $::hostname in $rm_hosts
>
> class { 'cdh5::hadoop':
>   # ...
>   rm_hosts => $rm_hosts,
>   # ...
> }
>  
>
> John
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e47a64ae-8eb6-45aa-b2b8-bc47008f245f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to