blob: c6152a8177234ba0e550ed1766d7c5d53168992b [file] [log] [blame]
dis50dba082016-12-09 00:43:03 +02001{% from 'mk22-lab-dvr-defaults.jinja' import DOMAIN_NAME with context %}
2{% from 'mk22-lab-dvr-defaults.jinja' import HOSTNAME_CFG01 with context %}
dis2b2d8632016-12-08 17:56:57 +02003
4# Install support services
5
6- description: Install keepalived
7 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
8 -C 'I@keepalived:cluster' state.sls keepalived -b 1
9 node_name: {{ HOSTNAME_CFG01 }}
10 retry: {count: 10, delay: 10}
11 skip_fail: true
12
13- description: Check the VIP
14 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
15 -C 'I@keepalived:cluster' cmd.run 'ip a | grep 172.16.10.2' | grep -B1 172.16.10.2
16 node_name: {{ HOSTNAME_CFG01 }}
17 retry: {count: 3, delay: 5}
18 skip_fail: false
19
20
21- description: Install glusterfs
22 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
23 -C 'I@glusterfs:server' state.sls glusterfs.server.service
24 node_name: {{ HOSTNAME_CFG01 }}
25 retry: {count: 3, delay: 5}
26 skip_fail: false
27
28- description: Setup glusterfs on primary controller
29 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
30 -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1
31 node_name: {{ HOSTNAME_CFG01 }}
32 retry: {count: 3, delay: 5}
33 skip_fail: false
34
35- description: Check the gluster status
36 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
37 -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 3, delay: 5}
40 skip_fail: false
41
42
43- description: Install RabbitMQ
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@rabbitmq:server' state.sls rabbitmq
46 node_name: {{ HOSTNAME_CFG01 }}
47 retry: {count: 3, delay: 5}
48 skip_fail: false
49
50- description: Check the rabbitmq status
51 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
52 -C 'I@rabbitmq:server' cmd.run 'rabbitmqctl cluster_status'
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 3, delay: 5}
55 skip_fail: false
56
57
58- description: '*Workaround* Update salt-formula-galera on config node to the latest
59 version'
60 cmd: apt-get -y --force-yes install salt-formula-galera
61 node_name: {{ HOSTNAME_CFG01 }}
62 retry: {count: 3, delay: 5}
63 skip_fail: false
64
65- description: Install Galera on first server
66 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
67 -C 'I@galera:master' state.sls galera
68 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 3, delay: 5}
70 skip_fail: false
71
72- description: Install Galera on other servers
73 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
74 -C 'I@galera:slave' state.sls galera
75 node_name: {{ HOSTNAME_CFG01 }}
76 retry: {count: 3, delay: 5}
77 skip_fail: false
78
79- description: Check mysql status
80 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
81 -C 'I@galera:*' mysql.status | grep -A1 -e "wsrep_incoming_addresses\|wsrep_cluster_size"
82 node_name: {{ HOSTNAME_CFG01 }}
83 retry: {count: 3, delay: 5}
84 skip_fail: true
85
86
87- description: Install haproxy
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
89 -C 'I@haproxy:proxy' state.sls haproxy
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 3, delay: 5}
92 skip_fail: false
93
94- description: Check haproxy status
95 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
96 -C 'I@haproxy:proxy' service.status haproxy
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 3, delay: 5}
99 skip_fail: false
100
101- description: Restart rsyslog
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
103 -C 'I@haproxy:proxy' service.restart rsyslog
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 3, delay: 5}
106 skip_fail: false
107
108- description: Install memcached on all controllers
109 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
110 -C 'I@memcached:server' state.sls memcached
111 node_name: {{ HOSTNAME_CFG01 }}
112 retry: {count: 3, delay: 5}
113 skip_fail: false