Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
PUP 4.9.4
-
None
-
Puppet Developer Experience
-
1
-
PDE 2017-03-22, PDE 2017-04-05
-
Bug Fix
-
-
No Action
-
covered by unit tests
Description
When using an array in hiera.yaml changes of global variables are ignored in puppet 4.9.4.
Example environments/development/hiera.yaml:
---
|
version: 5
|
|
defaults:
|
datadir: 'data'
|
data_hash: yaml_data
|
|
hierarchy:
|
- name: "Global settings"
|
path: "global.yaml"
|
- name: "Role specific settings"
|
paths:
|
- "roles/%{::roles.0}.yaml"
|
Example test.pp:
$roles = lookup('roles') |
$data = lookup('data', Array[String], 'unique') |
notify{"data: ${data}":} |
Example environments/development/data/global.yaml:
roles:
|
- test1
|
|
data:
|
- "from global"
|
Example environments/development/data/roles/test1.yaml:
data:
|
- 'from test1'
|
When running "puppet apply --environment=development test.pp" this results in:
Warning: Undefined variable '::roles';
|
(file & line not available)
|
Notice: Compiled catalog for hostname in environment development in 0.07 seconds
|
Notice: data: [from global]
|
Notice: /Stage[main]/Main/Notify[data: [from global]]/message: defined 'message' as 'data: [from global]'
|
Notice: Applied catalog in 0.17 seconds
|
|
When changing
"roles/%{::roles.0}.yaml"
|
to
"roles/%{roles.0}.yaml"
|
puppet apply returns:
Warning: Undefined variable 'roles';
|
(file & line not available)
|
Notice: Compiled catalog for hostname in environment development in 0.07 seconds
|
Notice: data: [from global, from test1]
|
Notice: /Stage[main]/Main/Notify[data: [from global, from test1]]/message: defined 'message' as 'data: [from global, from test1]'
|
Notice: Applied catalog in 0.17 seconds
|
In Puppet 4.9.3 both versions return the same result. This bug is probably related to PUP-7303.