From cc5820b3eb6855bb0a0ed7eaa3fa9088bad50cc0 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Sun, 25 Oct 2020 14:17:19 +0100 Subject: [PATCH] make dovecot running on localhost the default method for this role --- defaults/main.yml | 5 +++-- tasks/postfixadmin.yml | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 664ec81..afb01be 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,10 +1,11 @@ mailname: "{{inventory_hostname}}" -postfix_method: false +postfix_method: postfixadmin postfix_smtp_service: true postfix_submission_service: false +postfix_postfixadmin_mysql_host: localhost postfix_postfixadmin_mysql_database: postfixadmin postfix_postfixadmin_mysql_username: postfix @@ -14,7 +15,7 @@ postfix_check_spamhaus: false postfix_with_opendkim: false postfix_with_opendmarc: false -postfix_virtual_transport: virtual # lmtp:unix:private/dovecot-lmtp +postfix_virtual_transport: lmtp:unix:private/dovecot-lmtp postfix_submission_service_smtpd_sasl_path: private/auth diff --git a/tasks/postfixadmin.yml b/tasks/postfixadmin.yml index 17f5bd5..0deca39 100644 --- a/tasks/postfixadmin.yml +++ b/tasks/postfixadmin.yml @@ -8,7 +8,7 @@ - name: postfix sql map directory file: - path: /etc/postfix/sql/ + path: /etc/postfix/postfixadmin-sql/ state: directory mode: u=rwx,g=rx,o= group: postfix @@ -34,6 +34,6 @@ name: "{{postfix_postfixadmin_mysql_username}}" password: "{{postfix_postfixadmin_mysql_password}}" priv: "{{postfix_postfixadmin_mysql_database}}.*:SELECT" - host: "{{host_ip}}" + host: "{{postfix_postfixadmin_mysql_host}}" state: present - delegate_to: "{{postfix_postfixadmin_mysql_host}}" + delegate_to: "{{(postfix_postfixadmin_mysql_host=='localhost')|ternary(inventory_hostname,postfix_postfixadmin_mysql_host)}}"