Report abuse

postfix/manifests/init.pp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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

1
2
3
...
daemon_directory = <%= daemon_directory %>
...

ERROR from puppetd --test

1
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