From f35587edbf92f3f712b0ec8fdcf7047aa190de24 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Sun, 25 Oct 2020 14:18:29 +0100 Subject: [PATCH] make it work --- defaults/main.yml | 1 + tasks/main.yml | 13 +++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b97c588..2e12af6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,3 @@ +postfixadmin_mysql_host: localhost postfixadmin_mysql_database: postfixadmin postfixadmin_mysql_username: postfixadmin diff --git a/tasks/main.yml b/tasks/main.yml index 3f3b58a..5bd6cfc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,16 +4,16 @@ mysql_db: name: "{{postfixadmin_mysql_database}}" state: present - delegate_to: "{{postfixadmin_mysql_host}}" + delegate_to: "{{(postfixadmin_mysql_host=='localhost')|ternary(inventory_hostname,postfixadmin_mysql_host)}}" - name: mysql user mysql_user: name: "{{postfixadmin_mysql_username}}" password: "{{postfixadmin_mysql_password}}" priv: "{{postfixadmin_mysql_database}}.*:ALL,GRANT" - host: "{{host_ip}}" + host: "{{postfixadmin_mysql_host}}" state: present - delegate_to: "{{postfixadmin_mysql_host}}" + delegate_to: "{{(postfixadmin_mysql_host=='localhost')|ternary(inventory_hostname,postfixadmin_mysql_host)}}" - name: disable dbconfig debconf: @@ -48,13 +48,6 @@ group: www-data state: directory -# fix https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858005 -- name: fix postfixadmin setup bug (debian bug \#858005) - get_url: - url: https://raw.githubusercontent.com/postfixadmin/postfixadmin/ba94c3a75ea025762ad732b1a4c735251add8b0f/upgrade.php - dest: /usr/share/postfixadmin/upgrade.php - checksum: sha256:f2a87ded979be06250ab59f9cb4a26e70323b9f1aa962e5efe206b81ebb48d51 - - name: make postfixadmin-cli executable file: path: /usr/share/postfixadmin/scripts/postfixadmin-cli