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)}}"