Updates to many roles, including main user role to allow setting an alternate home directory

This commit is contained in:
2022-08-25 00:23:56 -06:00
parent 03ee154857
commit 6b36273324
36 changed files with 2619 additions and 9 deletions

View File

@@ -0,0 +1,26 @@
---
- name: "Update the my.cnf"
template: "src=etc_mysql_my.cnf.j2 dest=/etc/mysql/my.cnf owner=root mode=0644"
register: "config_file"
notify:
- "Restart percona"
- name: "Ensure that percona is running and enabled"
service:
name: "mysql"
state: "started"
enabled: "yes"
register: mysql_service
# This service restart is needed when changing default mysql_datadir, mysql_native_password
# and other settings. So better restart when the my.cnf file changes
# Restart when my.cnf has changed and it has not been restarted by the above task
- name: "Restart mysql to apply changes done in my.cnf file"
service:
name: "mysql"
state: "restarted"
when:
- config_file.changed
- mysql_service is defined
- not mysql_service.changed