Loop through database hosts
This commit is contained in:
parent
82012ccb99
commit
0f809c7799
2 changed files with 7 additions and 4 deletions
|
@ -5,7 +5,8 @@
|
||||||
state: present
|
state: present
|
||||||
login_unix_socket: "{{ mysql_socket }}"
|
login_unix_socket: "{{ mysql_socket }}"
|
||||||
login_user: root
|
login_user: root
|
||||||
delegate_to: "{{ phpmyadmin_database_host }}"
|
delegate_to: "{{ item }}"
|
||||||
|
loop: "{{ phpmyadmin_database_host }}"
|
||||||
|
|
||||||
- name: "Configuration | Create database user"
|
- name: "Configuration | Create database user"
|
||||||
community.mysql.mysql_user:
|
community.mysql.mysql_user:
|
||||||
|
@ -17,7 +18,8 @@
|
||||||
login_unix_socket: "{{ mysql_socket }}"
|
login_unix_socket: "{{ mysql_socket }}"
|
||||||
login_user: root
|
login_user: root
|
||||||
update_password: on_create
|
update_password: on_create
|
||||||
delegate_to: "{{ phpmyadmin_database_host }}"
|
delegate_to: "{{ item }}"
|
||||||
|
loop: "{{ phpmyadmin_database_host }}"
|
||||||
|
|
||||||
- name: "Configuration | Copy configuration"
|
- name: "Configuration | Copy configuration"
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
|
@ -22,9 +22,10 @@ foreach ($hosts as $verbose => $host) {
|
||||||
$cfg['Servers'][$i]['extension'] = 'mysqli';
|
$cfg['Servers'][$i]['extension'] = 'mysqli';
|
||||||
$cfg['Servers'][$i]['compress'] = FALSE;
|
$cfg['Servers'][$i]['compress'] = FALSE;
|
||||||
$cfg['Servers'][$i]['auth_type'] = 'cookie';
|
$cfg['Servers'][$i]['auth_type'] = 'cookie';
|
||||||
|
$cfg['Servers'][$i]['pmadb'] = '{{ phpmyadmin_database }}';
|
||||||
$cfg['Servers'][$i]['controlhost'] = $host;
|
$cfg['Servers'][$i]['controlhost'] = $host;
|
||||||
$cfg['Servers'][$i]['controlport'] = '3306';
|
$cfg['Servers'][$i]['controlport'] = '3306';
|
||||||
$cfg['Servers'][$i]['controluser'] = '{{ phpmyadmin_dbuser }}';
|
$cfg['Servers'][$i]['controluser'] = '{{ phpmyadmin_database }}';
|
||||||
$cfg['Servers'][$i]['controlpass'] = '{{ phpmyadmin_dbpass }}';
|
$cfg['Servers'][$i]['controlpass'] = '{{ phpmyadmin_database_password }}';
|
||||||
}
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue