Puppet Class: postfix
- Inherits:
- postfix::params
- Defined in:
- manifests/init.pp
Summary
The top-level class, to install and configure PostfixOverview
This class provides a basic setup of Postfix with local and remote delivery and an SMTP server listening on the loopback interface.
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'manifests/init.pp', line 259
class postfix (
String $alias_maps = 'hash:/etc/aliases',
Integer $amavis_procs = 2,
Optional[Boolean] $chroot = undef,
Stdlib::Absolutepath $confdir = '/etc/postfix',
Hash $conffiles = {},
Hash $configs = {},
Hash $hashes = {},
String $inet_interfaces = 'all',
String $inet_protocols = 'all',
Boolean $ldap = false,
Optional[String] $ldap_base = undef,
Optional[String] $ldap_host = undef,
Optional[String] $ldap_options = undef,
Array[String[1]] $ldap_packages = [],
String $lookup_table_type = 'hash',
Hash $mailaliases = {},
String $mail_user = 'vmail', # postfix_mail_user
Boolean $mailman = false,
String $mailx_ensure = 'present',
String $maincf_source = "puppet:///modules/${module_name}/main.cf",
Boolean $manage_aliases = true, # /etc/aliases
Boolean $manage_conffiles = true,
Boolean $manage_mailname = true,
Boolean $manage_mailx = true,
Boolean $manage_root_alias = true,
Hash $maps = {},
String $master_bounce_command = 'bounce',
String $master_defer_command = 'bounce',
Array[String] $master_entries = [], # postfix_master_entries
Optional[String] $master_smtp = undef, # postfix_master_smtp
Optional[String] $master_smtps = undef, # postfix_master_smtps
Optional[String] $master_submission = undef, # postfix_master_submission
Optional[String] $mastercf_content = undef,
Optional[String] $mastercf_source = undef,
Optional[String] $mastercf_template = undef,
Optional[Array[String[1]]] $masquerade_classes = undef,
Optional[Array[String[1]]] $masquerade_domains = undef,
Optional[Array[String[1]]] $masquerade_exceptions = undef,
Boolean $mta = false,
String $mydestination = '$myhostname, localhost.$mydomain, localhost', # postfix_mydestination
String $mynetworks = '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128', # postfix_mynetworks
String $myorigin = $facts['networking']['fqdn'],
String $postfix_ensure = 'present',
Optional[String] $relayhost = undef, # postfix_relayhost
String $root_group = 'root',
Variant[Array[String], String] $root_mail_recipient = 'nobody', # root_mail_recipient
Boolean $satellite = false,
Boolean $service_enabled = true,
String $service_ensure = 'running',
Variant[Array[String[1]], String[1]] $smtp_listen = '127.0.0.1', # postfix_smtp_listen
Hash $transports = {},
Boolean $use_amavisd = false, # postfix_use_amavisd
Boolean $use_dovecot_lda = false, # postfix_use_dovecot_lda
Variant[Integer[2, 3], Boolean] $use_schleuder = false, # postfix_use_schleuder
Boolean $use_sympa = false, # postfix_use_sympa
Hash $virtuals = {},
) inherits postfix::params {
if (
($mastercf_source and $mastercf_content) or
($mastercf_source and $mastercf_template) or
($mastercf_content and $mastercf_template) or
($mastercf_source and $mastercf_content and $mastercf_template)
) {
fail('mastercf_source, mastercf_content and mastercf_template are mutually exclusive')
}
$_smtp_listen = $mailman ? {
true => '0.0.0.0',
default => $smtp_listen,
}
$all_alias_maps = $ldap ? {
false => $alias_maps,
true => "${alias_maps}, ldap:${confdir}/ldap-aliases.cf",
}
$configs.each |$key, $value| {
postfix::config { $key:
* => $value,
}
}
$mailaliases.each |$key, $value| {
postfix::mailalias { $key:
* => $value,
}
}
$transports.each |$key, $value| {
postfix::transport { $key:
* => $value,
}
}
$virtuals.each |$key, $value| {
postfix::virtual { $key:
* => $value,
}
}
$hashes.each |$key, $value| {
postfix::hash { $key:
* => $value,
}
}
$conffiles.each |$key, $value| {
postfix::conffile { $key:
* => $value,
}
}
$maps.each |$key, $value| {
postfix::map { $key:
* => $value,
}
}
contain 'postfix::packages'
contain 'postfix::files'
contain 'postfix::service'
Class['postfix::packages']
-> Class['postfix::files']
~> Class['postfix::service']
if $ldap {
include postfix::ldap
}
if $mta {
if $satellite {
fail('enabling both the $mta and $satellite parameters is not supported. Please disable one.')
}
include postfix::mta
}
if $satellite {
if $mta {
fail('enabling both the $mta and $satellite parameters is not supported. Please disable one.')
}
include postfix::satellite
}
if $mailman {
include postfix::mailman
}
}
|