ruby - puppet stdlib 'member" function not working -


trying use member function of puppet stdlib module:

effectively:

$myvariable = 'foo' 

then when using member function:

member(['foo','bar'], $myvariable) 

i keep getting error message:

error: not retrieve catalog remote server: error 400 on server: function 'member' must value of statement @ /etc/puppet/modules/mymodule/manifests/init.pp:###   

looking @ stdlib documentation member, see member rvalue. means in context need have output assigned. error message of must value of statement hinting at. note helpful wikipedia article on l-values , r-values https://en.wikipedia.org/wiki/value_(computer_science)#lrvalue.

your code work, example, if assign output of member(['foo','bar'], $myvariable) variable or resource attribute.

for example:

$myvariable = 'foo' $variable = member(['foo','bar'], $myvariable) notify { $variable: } 

will result in notify 'true' during compilation.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -