## postfix/manifests/init.pp
class postfix {
case $operatingsystem {
centos: { include postfix::centos }
ubuntu: { include postfix::ubuntu }
}
file { "main.cf":
content => template("postfix/main.cf.erb"),
}
}
class postfix::centos {
$daemon_directory = "/usr/libexec/postfix"
}
class postfix::ubuntu {
$daemon_directory = "/usr/lib/postfix"
}
## postfix/templates/main.cf.erb
...
daemon_directory = <%= daemon_directory %>
...
## ERROR from puppetd --test
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template postfix/main.cf.erb: Could not find value for 'daemon_directory' at /etc/puppet/modules/postfix/manifests/init.pp:8