diff --git a/pillar/common.sls b/pillar/common.sls index f49cfaf..8601f26 100644 --- a/pillar/common.sls +++ b/pillar/common.sls @@ -57,6 +57,11 @@ profile: monitoring: checks: check_zypper: '/usr/lib/nagios/plugins/check_zypper -vrst 120 -ui /etc/monitoring-plugins/check_zypper-ignores.txt' + postfix: + aliases: + root: admin-auto@opensuse.org + maincf: + relayhost: '[relay.infra.opensuse.org]' rsyslog: custom: - salt://profile/log/files/etc/rsyslog.d/remote.conf.jinja diff --git a/pillar/role/proxy.sls b/pillar/role/proxy.sls index 016c8df..857f329 100644 --- a/pillar/role/proxy.sls +++ b/pillar/role/proxy.sls @@ -30,3 +30,8 @@ keepalived: - 195.135.221.143/25 dev external - 2620:113:80c0:8::18/64 dev external virtual_router_id: 51 + +profile: + postfix: + maincf: + relayhost: '' diff --git a/salt/profile/postfix/init.sls b/salt/profile/postfix/init.sls new file mode 100644 index 0000000..95795cf --- /dev/null +++ b/salt/profile/postfix/init.sls @@ -0,0 +1,27 @@ +postfix: + pkg.installed: [] + service.running: + - enable: True + +# update /etc/aliases +{%- for user, target in salt['pillar.get']('profile:postfix:aliases', {}).items() %} +postfix_alias_present_{{ user }}: + alias.present: + - name: {{ user }} + - target: {{ target }} +{%- endfor %} + +# update main.cf +# (only update options given in profile:postfix:maincf pillar, other settings stay unchanged) +{%- for option, value in salt['pillar.get']('profile:postfix:maincf', {}).items() %} +/etc/postfix/main.cf_{{ option }}: + file.replace: + - name: /etc/postfix/main.cf + - pattern: '^{{ option }} *=.*$' + - repl: '{{ option }} = {{ value }}' + - append_if_not_found: True + - require: + - pkg: postfix + - watch_in: + - service: postfix +{%- endfor %} diff --git a/salt/profile/wiki/init.sls b/salt/profile/wiki/init.sls index 5a3a55c..9841558 100644 --- a/salt/profile/wiki/init.sls +++ b/salt/profile/wiki/init.sls @@ -1,6 +1,5 @@ include: - profile.wiki.apache - profile.wiki.memcached - - profile.wiki.postfix - profile.wiki.docroot - profile.wiki.vhost_files diff --git a/salt/profile/wiki/postfix.sls b/salt/profile/wiki/postfix.sls deleted file mode 100644 index 59be291..0000000 --- a/salt/profile/wiki/postfix.sls +++ /dev/null @@ -1,7 +0,0 @@ -# just a simple setup for outgoing mails (watchlist notifications etc.) -postfix: - pkg.installed: - - pkgs: - - postfix - service.running: - - enable: True diff --git a/salt/role/base.sls b/salt/role/base.sls index cee2375..8d9cd90 100644 --- a/salt/role/base.sls +++ b/salt/role/base.sls @@ -4,6 +4,7 @@ include: - profile.ldap.client - profile.log - profile.monitoring + - profile.postfix - profile.regional - profile.salt.minion - profile.sysctl