From efacdce925c3858717c1ddbd317912042dd605da Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Thu, 30 Jul 2020 14:07:11 +0200 Subject: [PATCH] updated postfix state --- states/postfix/config.sls | 14 ++++++++------ states/postfix/defaults.yaml | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/states/postfix/config.sls b/states/postfix/config.sls index 44bff67..17aae05 100644 --- a/states/postfix/config.sls +++ b/states/postfix/config.sls @@ -1,11 +1,5 @@ --- {%- from "postfix/map.jinja" import postfix with context %} -postfix-pgsql-dir: - file.directory: - - name: {{ postfix.base_dir }}/pgsql - - user: root - - group: root - postfix-main-cf: file.managed: - name: {{ postfix.base_dir }}/main.cf @@ -28,6 +22,13 @@ postfix-master-cf: - watch_in: - service: postfix-service +{%- if postfix.db == 'pgsql' %} +postfix-pgsql-dir: + file.directory: + - name: {{ postfix.base_dir }}/pgsql + - user: root + - group: root + {%- for key, value in postfix.config.pgsql.files.items() %} postfix-pgsql-{{ key }}: file.managed: @@ -43,3 +44,4 @@ postfix-pgsql-{{ key }}: - watch_in: - service: postfix-service {% endfor %} +{%- endif %} diff --git a/states/postfix/defaults.yaml b/states/postfix/defaults.yaml index 1d34e46..a5dd1bc 100644 --- a/states/postfix/defaults.yaml +++ b/states/postfix/defaults.yaml @@ -4,6 +4,7 @@ postfix: base_dir: '/etc/postfix' pkgs: - postfix + db: None config: main: alias_database: 'hash:/etc/aliases' @@ -46,4 +47,4 @@ postfix: master: {} sender_access: {} transport: {} - pgsql: {} \ No newline at end of file + pgsql: {}