2 - name: install python-mysqldb
3 apt: name={{ item }} state=present force=yes
11 - name: download mariadb and galera deb package
12 get_url: url={{ item.url }} dest=/opt/{{ item.filename }}
18 - { url: "{{ MARIADB_URL }}", filename: "{{ MARIADB }}" }
19 - { url: "{{ GALERA_URL }}", filename: "{{ GALERA }}" }
21 - name: install mariadb and galera packages
22 command: dpkg -i /opt/{{ item }}
27 - name: create mysql log directy
28 file: path=/var/log/mysql state=directory owner=mysql group=mysql mode=0755
30 - name: update mariadb my.cnf
31 template: src=my.cnf dest=/etc/mysql/my.cnf backup=yes
33 - name: update galera wsrep.cnf
34 template: src=wsrep.cnf dest=/etc/mysql/conf.d/wsrep.cnf backup=yes
36 - name: update wsrep_sst_rsync uid
37 lineinfile: dest=/usr/bin/wsrep_sst_rsync state=absent regexp="\s*uid = \$MYUID$" backup=yes
39 - name: update wsrep_sst_rsync gid
40 lineinfile: dest=/usr/bin/wsrep_sst_rsync state=absent regexp="\s*gid = \$MYGID$" backup=yes
42 - name: manually restart mysql server
43 service: name=mysql state=restarted enabled=yes
51 - name: generate mysql service list
52 shell: echo {{ item }} >> /opt/service
57 - name: create database/user
59 when: HA_CLUSTER[inventory_hostname] == ''