diff --git a/ansible/roles/stv3-db/handlers/main.yaml b/ansible/roles/stv3-db/handlers/main.yaml new file mode 100644 index 0000000..3c2d961 --- /dev/null +++ b/ansible/roles/stv3-db/handlers/main.yaml @@ -0,0 +1,3 @@ +--- + - name: restart_mysql + action: service name=mysql state=restarted diff --git a/ansible/roles/stv3-db/tasks/main.yaml b/ansible/roles/stv3-db/tasks/main.yaml index c70379f..f70f861 100644 --- a/ansible/roles/stv3-db/tasks/main.yaml +++ b/ansible/roles/stv3-db/tasks/main.yaml @@ -16,7 +16,9 @@ ignore_errors: yes - name: copy .my.cnf file with root password credentials - template: src=my.cnf.j2 dest=/root/.my.cnf owner=root mode=0600 + template: src=my.cnf.j2 dest=/etc/mysql/my.cnf owner=root mode=0600 + notify: + - restart_mysql - mysql_db: name=winchester state=present login_user=root login_password={{ root_db_password }}