No error when using unknow var in exported resources
For instance, given
class foo {
@@bar { "bar":
test => "test"
}
}
define bar (
$test = undefined,
){
notify { "${tst}":}
}
puppetresources won't give any signal that tst is misspelled.
Actually even this is not failing:
@@bar { "bar":
unknown => "test"
}
The second case can be fixed with relative ease.
For the first case, it would require interpreting the bar define, which will be annoying (state would need to be restored after the interpretation), and won't work in many cases anyway. The exported resource is allowed to use context that is not existent on the current node (such as requiring resources that are only on the collecting node), and even a completely distinct set of .pp files (even though I suspect nobody does that).
I don't really know what the semantics is with regards to hiera. In that case:
define bar($test) { }
Does $test gets autoloaded from the exporting node context, or from the importing one ?
Does $test gets autoloaded from the exporting node context, or from the importing one ?
IIRC $test is interpreted in the importing (collector) context.
I will do some more testing to see how Puppet behaves exactly in the first case. For instance I think Puppet would reject the compilation at the exporting node (so before collecting) but I am not so sure (and it is a bit surprising).