33 lines
981 B
YAML
33 lines
981 B
YAML
---
|
|
- name: "Configuration | Create configuration database"
|
|
community.mysql.mysql_db:
|
|
name: "{{ phpmyadmin_database }}"
|
|
state: present
|
|
login_unix_socket: "{{ mysql_socket }}"
|
|
login_user: root
|
|
delegate_to: "{{ item }}"
|
|
loop: "{{ phpmyadmin_database_host }}"
|
|
|
|
- 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
|
|
update_password: on_create
|
|
delegate_to: "{{ item }}"
|
|
loop: "{{ phpmyadmin_database_host }}"
|
|
|
|
- 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
|