|
This test involves /etc/issue.
In this example is_test returns true.
/var/lib/hiera/common.yaml: classes:
-
config::issue
config::issue::content: 'puppet:///modules/config/issue'
/var/lib/hiera/test_%{::is_test}/common.yaml config::issue::content: 'puppet:///modules/config/issue-test'
/etc/puppet/manifests/site.pp hiera_include('classes')
/etc/puppet/modules/config/manifests/issue.pp class config::issue ( $content ) { tag 'config_issue'
file { '/etc/issue': ensure => file, group => 'root', mode => '0644', owner => 'root', seluser => 'system_u', selrole => 'object_r', seltype => 'etc_t', source => "$content"; }
}
In this format, everything works as expected. The following does not work as expected.
class config::issue { tag 'config_issue'
$content = hiera('config::issue::content')
file { '/etc/issue': ensure => file, group => 'root', mode => '0644', owner => 'root', seluser => 'system_u', selrole => 'object_r', seltype => 'etc_t', source => "$content"; }
}
In the first example, the content of issue-test is pulled down. In the second example, the content of issue is pulled down. According to http://docs.puppetlabs.com/hiera/1/puppet.html#limitations it should be doing a priority lookup on the parameter as passed. Also, according to http://docs.puppetlabs.com/hiera/1/puppet.html#hiera-lookup-functions hiera() is doing a standard priority lookup.
What I don't understand is, why does one way return issue-test and the other does not? If I am incorrect on any assumptions, I'd ask for some clarification.
|