diff options
Diffstat (limited to 'modules/postfix/manifests')
| -rw-r--r-- | modules/postfix/manifests/init.pp | 75 | ||||
| -rw-r--r-- | modules/postfix/manifests/server.pp | 13 | ||||
| -rw-r--r-- | modules/postfix/manifests/server/primary.pp | 43 | ||||
| -rw-r--r-- | modules/postfix/manifests/server/secondary.pp | 1 | ||||
| -rw-r--r-- | modules/postfix/manifests/simple_relay.pp | 9 |
5 files changed, 80 insertions, 61 deletions
diff --git a/modules/postfix/manifests/init.pp b/modules/postfix/manifests/init.pp index 5722e3e0..8a4394df 100644 --- a/modules/postfix/manifests/init.pp +++ b/modules/postfix/manifests/init.pp @@ -1,71 +1,24 @@ class postfix { - class base { - package { [postfix,nail]: } + package { postfix: } - service { postfix: - subscribe => Package['postfix'], - } - - file { '/etc/postfix/main.cf': - require => Package["postfix"], - content => "", - notify => Service['postfix'], - } + service { 'postfix': + subscribe => Package['postfix'], } - - class simple_relay inherits base { - File['/etc/postfix/main.cf'] { - content => template("postfix/simple_relay_main.cf"), - } + file { '/etc/postfix/main.cf': + require => Package['postfix'], + content => '', + notify => Service['postfix'], } - class smtp_server inherits base { - include postgrey - include amavis - include spamassassin - - File['/etc/postfix/main.cf'] { - content => template("postfix/main.cf"), - } - - file { '/etc/postfix/transport_regexp': - content => template("postfix/transport_regexp"), - } - - } - - class primary_smtp inherits smtp_server { - - package { "postfix-ldap": } - - # council is here until we fully decide who has aliases in com team, - # see https://bugs.mageia.org/show_bug.cgi?id=1345 - # alumini is a special group for tracking previous members of - # the project, so they keep their aliases for a time - $aliases_group = ['mga-founders','mga-packagers', - 'mga-sysadmin','mga-council', - 'mga-alumni','mga-i18n-committers', - ] - $ldap_password = extlookup("postfix_ldap",'x') - $ldap_servers = get_ldap_servers() - - file { - '/etc/postfix/master.cf': content => template("postfix/primary_master.cf"); - '/etc/postfix/ldap_aliases.conf': content => template("postfix/ldap_aliases.conf"); - # TODO merge the file with the previous one, for common part (ldap, etc) - '/etc/postfix/group_aliases.conf': content => template("postfix/group_aliases.conf"); - # TODO make it conditional to the presence of sympa - '/etc/postfix/sympa_aliases': content => template("postfix/sympa_aliases"); - '/etc/postfix/virtual_aliases': content => template("postfix/virtual_aliases"); - } - - exec { "postmap /etc/postfix/virtual_aliases": - refreshonly => true, - subscribe => File['/etc/postfix/virtual_aliases'], - } + file { '/etc/ssl/postfix/': + ensure => directory, } - class secondary_smtp inherits smtp_server { + openssl::self_signed_splitted_cert { "${::hostname}.${::domain}": + filename => 'postfix', + directory => '/etc/ssl/postfix/', + owner => 'postfix', + group => 'postfix' } } diff --git a/modules/postfix/manifests/server.pp b/modules/postfix/manifests/server.pp new file mode 100644 index 00000000..85ab261c --- /dev/null +++ b/modules/postfix/manifests/server.pp @@ -0,0 +1,13 @@ +class postfix::server inherits postfix { + include postgrey + include amavis + include spamassassin + + File['/etc/postfix/main.cf'] { + content => template('postfix/main.cf'), + } + + file { '/etc/postfix/transport_regexp': + content => template('postfix/transport_regexp'), + } +} diff --git a/modules/postfix/manifests/server/primary.pp b/modules/postfix/manifests/server/primary.pp new file mode 100644 index 00000000..c14a8606 --- /dev/null +++ b/modules/postfix/manifests/server/primary.pp @@ -0,0 +1,43 @@ +class postfix::server::primary inherits postfix::server { + + # Adding DKIM server + include opendkim + opendkim::domain{['mageia.org', 'sucuk.mageia.org', 'duvel.mageia.org', 'forums.mageia.org', 'madb.mageia.org','rabbit.mageia.org', 'fiona.mageia.org','identity.mageia.org', 'group.mageia.org', 'neru.mageia.org']:} + opendkim::trusted{['127.0.0.0/8', '212.85.158.0/24']:} + + package { ['postfix-ldap', 'sqlite3-tools', 'dovecot-plugins-sqlite','rspamd']: } + + # council is here until we fully decide who has aliases in com team, + + # see https://bugs.mageia.org/show_bug.cgi?id=1345 + # alumni is a special group for tracking previous members of + # the project, so they keep their aliases for a time + $aliases_group = ['mga-founders', + 'mga-packagers', + 'mga-sysadmin', + 'mga-council', + 'mga-alumni', + 'mga-i18n-committers'] + $ldap_password = extlookup('postfix_ldap','x') + $ldap_servers = get_ldap_servers() + + file { + '/etc/postfix/master.cf': + content => template('postfix/primary_master.cf'); + '/etc/postfix/ldap_aliases.conf': + content => template('postfix/ldap_aliases.conf'); + # TODO merge the file with the previous one, for common part (ldap, etc) + '/etc/postfix/group_aliases.conf': + content => template('postfix/group_aliases.conf'); + # TODO make it conditional to the presence of sympa + '/etc/postfix/sympa_aliases': + content => template('postfix/sympa_aliases'); + '/etc/postfix/virtual_aliases': + content => template('postfix/virtual_aliases'); + } + + exec { 'postmap /etc/postfix/virtual_aliases': + refreshonly => true, + subscribe => File['/etc/postfix/virtual_aliases'], + } +} diff --git a/modules/postfix/manifests/server/secondary.pp b/modules/postfix/manifests/server/secondary.pp new file mode 100644 index 00000000..e4dd8721 --- /dev/null +++ b/modules/postfix/manifests/server/secondary.pp @@ -0,0 +1 @@ +class postfix::server::secondary inherits postfix::server { } diff --git a/modules/postfix/manifests/simple_relay.pp b/modules/postfix/manifests/simple_relay.pp new file mode 100644 index 00000000..8911f781 --- /dev/null +++ b/modules/postfix/manifests/simple_relay.pp @@ -0,0 +1,9 @@ +class postfix::simple_relay inherits postfix { + File['/etc/postfix/main.cf'] { + content => template('postfix/simple_relay_main.cf'), + } + file { + '/etc/postfix/sympa_aliases': + content => template('postfix/sympa_aliases'); + } +} |
