Hi,
On 11/18/2013 01:50 AM, Jay Christopherson wrote:
> *versions.pp:*
> define parent::versions($version) {
> }
>
> *child.pp*:
> class parent::child {
> include parent
>
> notify{ "${version}": }
> }
>
> Variables and defaults declared in a local scope are only available
> in *that scope and its children*
> *
> *
> Clearly, I'm missing something here. I would expect this to print out
> the value of "$version", that is set by calling "create_resources" in
> the parent.
in this example, parent::child is *not* in fact a child of anything.
It's just a class in module called 'parent'.
Seeing as $version is a parameter of a defined type of your's, it
doesn't make sense to reference it anywhere else. Consider this:
class test {
parent::versions { "apache" => "2.2", ruby => "1.9.3" }
notify { "$version": }
}
What would you expect $version to be in this context?
Cheers,
Felix