2024-01-04 09:36:28 +01:00
|
|
|
---
|
|
|
|
- name: "Configuration | Create configuration database"
|
|
|
|
community.mysql.mysql_db:
|
|
|
|
name: "{{ phpmyadmin_database }}"
|
|
|
|
state: present
|
|
|
|
login_unix_socket: "{{ mysql_socket }}"
|
|
|
|
login_user: root
|
2024-01-04 10:25:54 +01:00
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
loop: "{{ phpmyadmin_database_host }}"
|
2024-01-04 09:36:28 +01:00
|
|
|
|
|
|
|
- name: "Configuration | Create database user"
|
|
|
|
community.mysql.mysql_user:
|
|
|
|
name: "{{ phpmyadmin_database }}"
|
|
|
|
host: "%"
|
|
|
|
password: "{{ phpmyadmin_database_password }}"
|
|
|
|
priv: "{{ phpmyadmin_database }}.*:ALL"
|
|
|
|
state: present
|
|
|
|
login_unix_socket: "{{ mysql_socket }}"
|
|
|
|
login_user: root
|
2024-01-04 10:25:54 +01:00
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
loop: "{{ phpmyadmin_database_host }}"
|
2024-01-04 09:36:28 +01:00
|
|
|
|
|
|
|
- name: "Configuration | Copy configuration"
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: pma.php.j2
|
|
|
|
dest: "/etc/phpmyadmin/conf.d/{{ inventory_hostname }}.php"
|
|
|
|
mode: "0644"
|
|
|
|
notify:
|
|
|
|
- Stop php-fpm-socket
|
|
|
|
- Stop php-fpm-service
|
|
|
|
- Start php-fpm-socket
|
|
|
|
- Start php-fpm-service
|