Updates to many roles, including main user role to allow setting an alternate home directory
This commit is contained in:
26
db/mysql-percona/tasks/configure.yml
Normal file
26
db/mysql-percona/tasks/configure.yml
Normal 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
|
||||
Reference in New Issue
Block a user