Removed fuel from Genesis master since fuel has moved to repo fuel.
[genesis.git] / compass / deploy / ansible / roles / database / tasks / mariadb.yml
1 ---
2 - name: install python-mysqldb
3   apt: name={{ item }} state=present force=yes
4   with_items:
5       - libaio1
6       - libssl0.9.8
7       #- mariadb-client-5.5
8       - mysql-client-5.5
9       - python-mysqldb
10       - mysql-server-wsrep
11       - galera
12
13 - name: create mysql log directy
14   file: path=/var/log/mysql state=directory owner=mysql group=mysql mode=0755
15
16 - name: update mariadb my.cnf
17   template: src=my.cnf dest=/etc/mysql/my.cnf backup=yes
18
19 - name: update galera wsrep.cnf
20   template: src=wsrep.cnf dest=/etc/mysql/conf.d/wsrep.cnf backup=yes
21
22 - name: update wsrep_sst_rsync uid 
23   lineinfile: dest=/usr/bin/wsrep_sst_rsync state=absent regexp="\s*uid = \$MYUID$"  backup=yes
24
25 - name: update wsrep_sst_rsync gid 
26   lineinfile: dest=/usr/bin/wsrep_sst_rsync state=absent regexp="\s*gid = \$MYGID$"  backup=yes
27
28 - name: manually restart mysql server
29   service: name=mysql state=restarted enabled=yes
30   register: result
31   until: result|success
32   retries: 5
33   delay: 5
34   tags:
35     - mysql_restart
36
37 - name: generate mysql service list
38   shell: echo {{ item }} >> /opt/service
39   with_items:
40    - mysql
41
42 - name: create database/user
43   shell: /opt/data.sh
44   when: HA_CLUSTER[inventory_hostname] == ''
45   tags:
46     - mysql_user