diff --git a/postfix/defaults.yaml b/postfix/defaults.yaml new file mode 100644 index 0000000..bbe615e --- /dev/null +++ b/postfix/defaults.yaml @@ -0,0 +1,5 @@ +postfix: + package: postfix + service: postfix + aliases_file: /etc/aliases + config_dir: /etc/postfix diff --git a/postfix/map.jinja b/postfix/map.jinja index dc1df91..b044d5a 100644 --- a/postfix/map.jinja +++ b/postfix/map.jinja @@ -1,36 +1,12 @@ -{% set postfix = salt['grains.filter_by']({ - 'Debian': { - 'package': 'postfix', - 'policyd_spf_pkg': 'postfix-policyd-spf-python', - 'postsrsd_pkg': 'postsrsd', - 'postgrey_pkg': 'postgrey', - 'pcre_pkg': 'postfix-pcre', - 'mysql_pkg': 'postfix-mysql', - 'service': 'postfix', - 'aliases_file': '/etc/aliases', - }, - 'Gentoo': { - 'package': 'mail-mta/postfix', - 'policyd_spf_pkg': 'mail-filter/pypolicyd-spf', - 'postsrsd_pkg': 'mail-filter/postsrsd', - 'postgrey_pkg': 'mail-filter/postgrey', - 'service': 'postfix', - 'aliases_file': '/etc/mail/aliases', - }, - 'RedHat': { - 'package': 'postfix', - 'policyd_spf_pkg': 'pypolicyd-spf', - 'postsrsd_pkg': 'postsrsd', - 'postgrey_pkg': 'postgrey', - 'service': 'postfix', - 'aliases_file': '/etc/aliases', - }, - 'Arch' : { - 'package': 'postfix', - 'policyd_spf_pkg': 'python-postfix-policyd-spf', - 'postsrsd_pkg': 'postsrsd', - 'postgrey_pkg': 'postgrey', - 'service': 'postfix', - 'aliases_file': '/etc/aliases', - }, -}, merge=salt['pillar.get']('postfix:lookup')) %} +{% import_yaml "postfix/defaults.yaml" as defaults %} +{% import_yaml "postfix/osmap.yaml" as osmap %} + +{% set postfix = salt['grains.filter_by']( + defaults, + merge=salt['grains.filter_by']( + osmap, + grain='os', + merge=salt['pillar.get']('postfix:lookup', {}), + ), + base='postfix') + %} diff --git a/postfix/osmap.yaml b/postfix/osmap.yaml new file mode 100644 index 0000000..d9d0ccf --- /dev/null +++ b/postfix/osmap.yaml @@ -0,0 +1,24 @@ +Debian: + policyd_spf_pkg: postfix-policyd-spf-python + postsrsd_pkg: postsrsd + postgrey_pkg: postgrey + pcre_pkg: postfix-pcre + mysql_pkg: postfix-mysql + +Gentoo: + package: mail-mta/postfix + policyd_spf_pkg: mail-filter/pypolicyd-spf + postsrsd_pkg: mail-filter/postsrsd + postgrey_pkg: mail-filter/postgrey + aliases_file: /etc/mail/aliases + +RedHat: + policyd_spf_pkg: pypolicyd-spf + postsrsd_pkg: postsrsd + postgrey_pkg: postgrey + +Arch: + policyd_spf_pkg: python-postfix-policyd-spf + postsrsd_pkg: postsrsd + postgrey_pkg: postgrey +