Details
Description
Given data in a module class:
class ntp (
|
Optional[String] $ticker_file
|
) {
|
...
|
}
|
and hiera data in the module:
ntp::ticker_file: ~
|
The nil is interpreted as a hash:
% puppet lookup --explain --modulepath `pwd` ntp::ticker_file
|
Merge strategy first
|
Data Binding "hiera"
|
No such key: "ntp::ticker_file"
|
Data Provider "EnvironmentDataProvider"
|
No such key: "ntp::ticker_file"
|
Module "ntp" using Data Provider "Hiera Data Provider, version 4"
|
ConfigurationPath "/example/ntp/hiera.yaml"
|
Merge strategy first
|
Data Provider "OS family"
|
Path "/example/ntp/data/os/RedHat.yaml"
|
Original path: "os/%{facts.os.family}"
|
Path not found
|
Data Provider "defaults"
|
Path "/example/ntp/data/defaults.yaml"
|
Original path: "defaults"
|
Found key: "ntp::ticker_file" value: {}
|
Merged result: {}
|
Merged result: {}
|
While the YAML is correctly interpreted by ruby as a nil:
% /opt/puppetlabs/puppet/bin/ruby -r yaml -e 'p YAML.load(File.read("ntp/data/defaults.yaml"))["ntp::ticker_file"]'
|
nil
|
And to be clear its puppet the error is:
Error: Evaluation Error: Error while evaluating a Function Call, Class[Ntp]: parameter 'ticker_file' expects a String value, got Hash
|
Attachments
Issue Links
- is duplicated by
-
MODULES-4363 puppetlabs/ntp fails on default parameter calculation
-
- Closed
-
- links to