diff --git a/bin/prepare_minion.py b/bin/prepare_minion.py index 7bddba1..a1f15bd 100755 --- a/bin/prepare_minion.py +++ b/bin/prepare_minion.py @@ -28,6 +28,7 @@ file_roots: - /srv/salt - /srv/formulas/salt-formula - /srv/formulas/users-formula + - /srv/formulas/postfix-formula ''') os.symlink(mypwd + '/salt', '/srv/salt') diff --git a/pillar/common.sls b/pillar/common/init.sls similarity index 69% rename from pillar/common.sls rename to pillar/common/init.sls index d423f73..7665aa6 100644 --- a/pillar/common.sls +++ b/pillar/common/init.sls @@ -1,12 +1,8 @@ include: - role.salt.common - role.salt.minion + - common.{{ grains['os'] | lower }} managed_header_pound: | ### This file is managed via https://git.com.de/LibertaCasa/salt ### Manual changes will be overwritten - -{%- if grains['os'] == 'SUSE' %} -zypper: - refreshdb_force: False -{%- endif %} diff --git a/pillar/common/postfix.sls b/pillar/common/postfix.sls new file mode 100644 index 0000000..15c3d07 --- /dev/null +++ b/pillar/common/postfix.sls @@ -0,0 +1,26 @@ +postfix: + master_config: + services: + smtp: + enable: False + config: + # to-do: set via site config + relayhost: zz0.email + myhostname: {{ grains['fqdn'] }} + inet_interfaces: loopback-only + # to-do: support relay via IPv6 + inet_protocols: ipv4 + alias_maps: lmdb:/etc/aliases + smtpd_use_tls: 'no' + smtp_use_tls: 'yes' + smtp_tls_security_level: encrypt + smtp_tls_wrappermode: 'yes' + + aliases: + use_file: false + present: + admins: 'georg, pratyush' + georg: georg@lysergic.dev + pratyush: pratyush@lysergic.dev + root: 'system, \root' + system: system@lysergic.dev diff --git a/pillar/common/suse.sls b/pillar/common/suse.sls new file mode 100644 index 0000000..f3456ed --- /dev/null +++ b/pillar/common/suse.sls @@ -0,0 +1,6 @@ +include: + - .postfix + +zypper: + refreshdb_force: False + diff --git a/pillar/role/salt/master.sls b/pillar/role/salt/master.sls index b306637..cafd05d 100644 --- a/pillar/role/salt/master.sls +++ b/pillar/role/salt/master.sls @@ -1,4 +1,4 @@ -{%- set formulas = ['salt', 'users'] -%} +{%- set formulas = ['salt', 'users', 'postfix'] -%} salt: interface: ${'secret_salt:master:interface'} diff --git a/salt/common/postfix.sls b/salt/common/postfix.sls new file mode 100644 index 0000000..d5b51d4 --- /dev/null +++ b/salt/common/postfix.sls @@ -0,0 +1,3 @@ +include: + - postfix + - postfix.config diff --git a/salt/common/suse.sls b/salt/common/suse.sls index e655353..d76da87 100644 --- a/salt/common/suse.sls +++ b/salt/common/suse.sls @@ -3,6 +3,7 @@ include: - profile.zypp - profile.node_exporter - users + - .postfix {#- to-do: move this to some formula or macro -#} {%- set osfullname = grains['osfullname'] -%}