On Thursday, October 24, 2013 9:27:58 AM UTC-4, jcbollinger wrote:
>
>
>
> On Wednesday, October 23, 2013 10:07:37 AM UTC-5, Bob Jones wrote:
>>
>> Hello all.  I have been banging my head against this problem and I cannot 
>> for the life of me determine what is wrong.  We are running Puppet v3.2.2. 
>>  Here's the situation:
>>
>> We have a module called domex.  The domex modules has an init.pp that 
>> defines a domex class.  Various things happen in that module, but the 
>> important part is some variable definitions, so I'll whittle it down.
>>
>> init.pp:
>> class domex {
>>   $nifi_dir = 
>> extlookup('nifi_install_base_dir','/opt/niagarafiles/default','iep')
>>   $storm_streaming_pkg_reqs = "infrastructure-deps-iep-storm-addon"
>> }
>>
>> I've put notify statements in so I can verify the contents of the 
>> variables are correct in the init.pp and they are.
>>
>> Now, I have two subclasses, each defined in their own files.
>>
>>
>
> Nitpick: the classes you describe next are not *sub*classes; those 
> involve class inheritance.  Yours are simply other classes in the module.
>

You're right, sorry.  When I started working on these modules they were 
subclasses that inherited domex instead of the include, but that didn't 
work either and seemed to be against best practice.
 

>  
>
>> nifi.pp:
>> class domex::nifi {
>>   include domex
>>   $nifi_dir   = $domex::nifi_dir
>> }
>>
>> A notify statement shows that $nifi_dir gets populated with the correct 
>> value.
>>
>> storm.pp
>> class domex::storm {
>>   include domex
>>   $storm_pkg_reqs = $domex::storm_streaming_pkg_reqs
>> }
>>
>> In this case, $storm_pkg_reqs ends up no value.  The value of 
>> $domex::storm_streaming_pkg_reqs also has no value.
>>
>> Nothing else touches any of these variables in any other manifest.  I do 
>> not the reason $storm_pkg_reqs ends up being undefined.  I know this setup 
>> seems a bit convoluted, but it's not my choice, I'm having to take existing 
>> puppet modules and tweak them for our environment, so wholesale structural 
>> changes are out of the question (no matter how much I might like to make 
>> them).
>>
>> Any and all help would be greatly appreciated!
>>
>>
>
> I do not see any problem with the code you posted.  Are you certain it is 
> exactly what appears in your manifests?  The behavior you describe could 
> easily be explained by a difference between init.pp and storm.pp in the 
> spelling of the variable name.  Perhaps something subtle such as an 
> accidentally doubled underscore somewhere.
>

This was my initiial thought as well, but I copied and pasted the values of 
each variable and did searches for them in vim and the proper variables 
were found, so it's not a naming issue.

To expand a little, it seems none of the variables in the domex::storm 
class, all of which reference $domex::var are getting properly evaluated, 
whereas the ones in domex::nifi class are.  They both have the include 
domex line and that's it.  It has to be something obvious that I'm missing, 
but I just can't see what.

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to