If I stick a "notify { "$version": }" into the define, it shows the expected value, so my issue appears to be scope access.
On Sun, Nov 17, 2013 at 4:50 PM, Jay Christopherson <jc.listm...@gmail.com>wrote: > I have a parent class, a child class, and a defined type, like so: > > *init.pp*: > class parent { > create_resources(parent::versions, hiera('versions')) > ... > } > > *versions.pp:* > define parent::versions($version) { > } > > *child.pp*: > class parent::child { > include parent > > notify{ "${version}": } > } > > (I'm omitting the hiera definition since I don't think it relates to the > issue). > > Basically, I'm trying to figure out how to access variables from a child > class, that have been defined in the parent via create_resources. > > According to the documentation I read, I think this can be done: > > 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. > > Can someone correct me or point me in the right direction? > > Regards- > JC > > -- 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/CAFwM5Hw0ye_kLnkoSXjNMcJHeKbc-HqdvNxNyzHVZhHNDVrABA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.