FAQ
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.

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!

Thanks,
Bob

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

Search Discussions

  • Bob Jones at Oct 24, 2013 at 12:57 pm
    I guess I'm not the only one stumped by this problem. :)

    Bob
    On Wednesday, October 23, 2013 11:07:37 AM UTC-4, 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.

    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!

    Thanks,
    Bob
    --
    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+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jcbollinger at Oct 24, 2013 at 1:28 pm

    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.


    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.


    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Bob Jones at Oct 24, 2013 at 2:06 pm

    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jcbollinger at Oct 25, 2013 at 1:17 pm
    Have you restarted the master since the last time you modified any of these
    classes? Puppet is sometimes finicky about that.


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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedOct 23, '13 at 3:10p
activeOct 25, '13 at 1:17p
posts5
users2
websitepuppetlabs.com

2 users in discussion

Bob Jones: 3 posts Jcbollinger: 2 posts

People

Translate

site design / logo © 2021 Grokbase