In Puppet, how can I access a variable/attribute inside a defined type?
问题 I would like to reference variables inside instances of defined types. For example, what can I do to reference $x and $y of foo a in bar b ? define foo($x, $y) { } define bar($foo) { notify { "${::$foo::x}": } # <- how to make this reference work? } foo { 'a': x => 'oh bar may you reference me', y => 'please' } bar { 'b': foo => Foo['a'], require => Foo['a'] } The reason why I would like this to work is that a foo instance may contain many values that I wouldn't like to repeat to each and