diff --git a/postfix/map.jinja b/postfix/map.jinja index 91af35d..eb79ddb 100644 --- a/postfix/map.jinja +++ b/postfix/map.jinja @@ -1,18 +1,22 @@ {% set postfix = salt['grains.filter_by']({ 'Debian': { 'packages': ['postfix', 'postfix-policyd-spf-python'], + 'postgrey_pkg': 'postgrey', 'service': 'postfix', }, 'Gentoo': { 'packages': ['mail-mta/postfix'], + 'postgrey_pkg': 'postgrey', 'service': 'postfix', }, 'RedHat': { 'packages': ['postfix'], + 'postgrey_pkg': 'postgrey', 'service': 'postfix', }, 'Arch' : { 'packages': ['postfix'], + 'postgrey_pkg': 'postgrey', 'service': 'postfix', }, }, merge=salt['pillar.get']('postfix:lookup')) %} diff --git a/postfix/postgrey.sls b/postfix/postgrey.sls new file mode 100644 index 0000000..e12482c --- /dev/null +++ b/postfix/postgrey.sls @@ -0,0 +1,15 @@ +{% from "postfix/map.jinja" import postfix with context %} + +postgrey: + pkg.installed: + - name: {{ postfix.postgrey_pkg }} + - watch_in: + - service: postgrey + + service.running: + - enable: True + - require: + - pkg: postgrey + - watch: + - pkg: postgrey +