Details
Description
Given this hiera config:
bash-4.1# cat /etc/puppet/hiera.yaml
|
---
|
|
:backends:
|
- yaml
|
|
:hierarchy:
|
- one
|
- two
|
|
:yaml:
|
:datadir: '/etc/puppet/hieradata'
|
|
:merge_behavior: deeper
|
|
...
|
and this values:
bash-4.1# cat /etc/puppet/hieradata/{one,two}.yaml
|
---
|
|
foo::message: one
|
|
...
|
---
|
|
foo::message: two
|
|
...
|
if I run this code:
bash-4.1# cat fail.pp
|
class foo ( $message = hiera_array('foo::message') ) { notify { $message: } }
|
include ::foo
|
it produces unexpected output:
bash-4.1# puppet apply fail.pp
|
Notice: Compiled catalog for 435d243ccf29.ofi.softonic.lan in environment production in 0.48 seconds
|
Notice: one
|
Notice: /Stage[main]/Foo/Notify[one]/message: defined 'message' as 'one'
|
Notice: Finished catalog run in 0.05 seconds
|
whereas if I run this other code:
bash-4.1# cat win.pp
|
class foo {
|
$message = hiera_array('foo::message')
|
notify { $message: }
|
}
|
include ::foo
|
It produces the expected output:
bash-4.1# puppet apply win.pp
|
Notice: Compiled catalog for 435d243ccf29.ofi.softonic.lan in environment production in 0.35 seconds
|
Notice: one
|
Notice: /Stage[main]/Foo/Notify[one]/message: defined 'message' as 'one'
|
Notice: two
|
Notice: /Stage[main]/Foo/Notify[two]/message: defined 'message' as 'two'
|
Notice: Finished catalog run in 0.07 seconds
|
Shouldn't it be the same output in both situations?
Attachments
Issue Links
- duplicates
-
PUP-5395 Set resolution_type when using data bindings by using lookup_options
-
- Closed
-
- links to