diff --git a/defaults/main.yml b/defaults/main.yml index affcc56..b97c588 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,2 @@ postfixadmin_mysql_database: postfixadmin postfixadmin_mysql_username: postfixadmin -postfixadmin_mysql_password: eehahhoaQuai3oomochep7ca diff --git a/tasks/main.yml b/tasks/main.yml index d8a025d..9b4e70f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,6 +4,7 @@ mysql_db: name: "{{postfixadmin_mysql_database}}" state: present + delegate_to: "{{postfixadmin_mysql_host}}" - name: mysql user mysql_user: @@ -11,6 +12,7 @@ password: "{{postfixadmin_mysql_password}}" priv: "{{postfixadmin_mysql_database}}.*:ALL,GRANT" state: present + delegate_to: "{{postfixadmin_mysql_host}}" - name: disable dbconfig debconf: diff --git a/templates/dbconfig.inc.php.j2 b/templates/dbconfig.inc.php.j2 index 1134069..06cf63b 100644 --- a/templates/dbconfig.inc.php.j2 +++ b/templates/dbconfig.inc.php.j2 @@ -13,6 +13,6 @@ $dbuser='{{postfixadmin_mysql_username}}'; $dbpass='{{postfixadmin_mysql_password}}'; $basepath=''; $dbname='{{postfixadmin_mysql_database}}'; -$dbserver='localhost'; +$dbserver='{{postfixadmin_mysql_host}}'; $dbport='3306'; $dbtype='mysqli';