From 1792b588518bc81833d988c144409e248fc39028 Mon Sep 17 00:00:00 2001 From: Imran Haider Date: Sat, 11 Jul 2015 05:31:11 -0400 Subject: [PATCH] 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 +