I don't think there is a right way to do the following (yet) in Puppet, but this strikes me as desirable.
I want my classes to be able to influence the content of a templated file from another class so that we can both avoid duplicating information, and put the info where it belongs.
For instance we have an "iptables" class, and various service classes, such as "postfix", "webappfoo" etc.
class webappfoo {
$myfwrules +> [ "-A INPUT -p tcp --state NEW -m tcp --dport 80 -j ACCEPT" ]
include apache
}
node webappserver {
include webappfoo
include iptables
}
But this does not work; the $myfwrules array only contains that line within webappfoo.
Note that a class can read into another one; for instance here iptables could just read $iptables::myfwrules; but I don't want iptables to have to know about webappfoo.