Re: [Puppet Users] Replace multiple expression with a variable in a selector

2014-01-15 Thread Felix Frank
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

Re: [Puppet Users] Replace multiple expression with a variable in a selector

2014-01-15 Thread Francisco José Bejarano
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

Re: [Puppet Users] Replace multiple expression with a variable in a selector

2014-01-15 Thread Francisco José Bejarano
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" ] {

Re: [Puppet Users] Replace multiple expression with a variable in a selector

2014-01-15 Thread Andrey Kozichev
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

[Puppet Users] Replace multiple expression with a variable in a selector

2014-01-15 Thread Francisco José Bejarano
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