diff --git a/tasks/configuration.yml b/tasks/configuration.yml index 3e56623..1d474f7 100644 --- a/tasks/configuration.yml +++ b/tasks/configuration.yml @@ -5,7 +5,8 @@ state: present login_unix_socket: "{{ mysql_socket }}" login_user: root - delegate_to: "{{ phpmyadmin_database_host }}" + delegate_to: "{{ item }}" + loop: "{{ phpmyadmin_database_host }}" - name: "Configuration | Create database user" community.mysql.mysql_user: @@ -17,7 +18,8 @@ login_unix_socket: "{{ mysql_socket }}" login_user: root update_password: on_create - delegate_to: "{{ phpmyadmin_database_host }}" + delegate_to: "{{ item }}" + loop: "{{ phpmyadmin_database_host }}" - name: "Configuration | Copy configuration" ansible.builtin.template: diff --git a/templates/pma.php.j2 b/templates/pma.php.j2 index 1e07a92..9a83044 100644 --- a/templates/pma.php.j2 +++ b/templates/pma.php.j2 @@ -22,9 +22,10 @@ foreach ($hosts as $verbose => $host) { $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['compress'] = FALSE; $cfg['Servers'][$i]['auth_type'] = 'cookie'; + $cfg['Servers'][$i]['pmadb'] = '{{ phpmyadmin_database }}'; $cfg['Servers'][$i]['controlhost'] = $host; $cfg['Servers'][$i]['controlport'] = '3306'; - $cfg['Servers'][$i]['controluser'] = '{{ phpmyadmin_dbuser }}'; - $cfg['Servers'][$i]['controlpass'] = '{{ phpmyadmin_dbpass }}'; + $cfg['Servers'][$i]['controluser'] = '{{ phpmyadmin_database }}'; + $cfg['Servers'][$i]['controlpass'] = '{{ phpmyadmin_database_password }}'; } {% endif %}