General remark: You should use hiera() to retrieve that value.
hiera_array() is only useful in very specific situations, and only if
you have a non-trivial hierarchy.
On 01/15/2014 03:02 PM, Francisco José Bejarano wrote:
>
> HOSTS_TESTING:
> - 'host1'
> - 'host2'
> - 'hos
With this runs
hiera yaml
HOSTS_TESTING:
- 'host1'
- 'host2'
- 'host3'
and manifest
$HOSTS_TESTING = hiera_array('HOSTS_TESTING')
if $::hostname in $HOSTS_TESTING {
$testing = 'filetest'
} else {
$testing = 'file'
}
El miércoles, 15 de enero de 2014
Not runs
I have tried with all combinatios of quotes, arrays, hiera, etc. Only runs
with literal values in the expression even I have replaced the selector
with if statement
if $::hostname [ $variable ] {
and neither runs only with literal values
if $::hostname [ "host1","host2","host3" ] {
try $VARIABLE ='(host1|host2|host3)'
$testing = $::hostname ? {
/$VARIABLE/ => 'filetest',
default=> 'file',
}
On 15 January 2014 11:19, Francisco José Bejarano wrote:
> Greetings to all
>
> I have a question about the use of selectors. I am using 3.4.2
>
> I have this selector in
Greetings to all
I have a question about the use of selectors. I am using 3.4.2
I have this selector in my code
$testing = $::hostname ? {
/(host1|host2|host3)/ => 'filetest',
default=> 'file',
}
I would like to use a variable as a multiple expression in a selector