Restart when config changed

pull/6/head
Emilien Mantel 2015-08-21 10:14:23 +02:00
parent 1ee8ca005b
commit 265dc13e50
1 changed files with 5 additions and 6 deletions

View File

@ -17,15 +17,14 @@
- name: TEMPLATE | Deploy configuration - name: TEMPLATE | Deploy configuration
template: src=etc/mysql/my.cnf.j2 dest=/etc/mysql/my.cnf template: src=etc/mysql/my.cnf.j2 dest=/etc/mysql/my.cnf
register: config register: config
notify: restart mysql
- name: SERVICE | Restart now (prevent bugs)
service: name=mysql state=restarted
when: config.changed
- name: TEMPLATE | Deploy extra configuration - name: TEMPLATE | Deploy extra configuration
template: src=etc/mysql/conf.d/10-extra.cnf.j2 dest=/etc/mysql/conf.d/10-extra.cnf template: src=etc/mysql/conf.d/10-extra.cnf.j2 dest=/etc/mysql/conf.d/10-extra.cnf
notify: restart mysql register: extraconfig
- name: SERVICE | Restart now (prevent bugs)
service: name=mysql state=restarted
when: config.changed or extraconfig.changed
- name: TEMPLATE Create .my.cnf for root - name: TEMPLATE Create .my.cnf for root
template: src=root/my.cnf dest=/root/.my.cnf owner=root group=root mode=0600 backup=yes template: src=root/my.cnf dest=/root/.my.cnf owner=root group=root mode=0600 backup=yes