Hello everybody,
When I do puppet apply, I get the error:
Warning: Scope(Mod::Cl[title]): Can't load '/tmp/file.yaml' File does not exist!
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Operator '[]' is not applicable to an Undef Value.
I specify that loadyaml is a function of stdlib module
However, i want to execute file resource before define resource
Someone can help me ?
class mod::princ ( file { '/tmp/file.yaml': ensure => file, owner => 'root', group => 'root', mode => '0644', source => "puppet:///modules/othermod/file.yaml", before => Mod::Cl["title"], }-> Mod::Cl{ "title" : tmp_file => "/tmp/file.yaml", } } define mod::cl ( String $tmp_file, ){ $tmp = loadyaml("$tmp_file") $tmp[var].each |Integer $i, Hash[String,String] $var| { $mark=$var['Mark'] } }