I'm trying to resolve a YAML value in a module
file { '/boot/config.txt' :
ensure => present,
mode => '0755',
content => $::hostname?{
'serverName1.domain' => template('template1'),
default => template('template2'),
}
}
above with hardcoded names works nicely, however I'm trying to something like this:
file { '/boot/config.txt' :
ensure => present,
mode => '0755',
content => $::hostname?{
<%= scope.call_function('hiera',['server_name_in_hiera']) %> => template('template1'),
default => template('template2'),
}
}
I'm sure its doable and I'm just doing something stupid.
Thanks