From 0e3d0778bd68b6efad77b40e4e1a7f030534f2b8 Mon Sep 17 00:00:00 2001 From: Imran Haider Date: Sat, 20 Jun 2015 16:53:01 -0400 Subject: [PATCH 1/2] Add postgrey to list of packages to be installed in Arch --- postfix/map.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postfix/map.jinja b/postfix/map.jinja index 91af35d..624e6fa 100644 --- a/postfix/map.jinja +++ b/postfix/map.jinja @@ -12,7 +12,7 @@ 'service': 'postfix', }, 'Arch' : { - 'packages': ['postfix'], + 'packages': ['postfix', 'postgrey'], 'service': 'postfix', }, }, merge=salt['pillar.get']('postfix:lookup')) %} From 1792b588518bc81833d988c144409e248fc39028 Mon Sep 17 00:00:00 2001 From: Imran Haider Date: Sat, 11 Jul 2015 05:31:11 -0400 Subject: [PATCH 2/2] separate postgrey into a separate module --- postfix/map.jinja | 6 +++++- postfix/postgrey.sls | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 postfix/postgrey.sls diff --git a/postfix/map.jinja b/postfix/map.jinja index 624e6fa..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'], + '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 +