blob: 67b52ec5c054d032eb04232224b6661414aaf062 [file] [log] [blame]
Dennis Dmitrievab83ea42017-05-12 16:52:45 +03001{% from 'mk22-lab-dvr/map.jinja' import DOMAIN_NAME with context %}
2{% from 'mk22-lab-dvr/map.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
dis2b2d8632016-12-08 17:56:57 +020058- description: Install Galera on first server
59 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
60 -C 'I@galera:master' state.sls galera
61 node_name: {{ HOSTNAME_CFG01 }}
62 retry: {count: 3, delay: 5}
63 skip_fail: false
64
65- description: Install Galera on other servers
66 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
67 -C 'I@galera:slave' state.sls galera
68 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 3, delay: 5}
70 skip_fail: false
71
72- description: Check mysql status
73 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
74 -C 'I@galera:*' mysql.status | grep -A1 -e "wsrep_incoming_addresses\|wsrep_cluster_size"
75 node_name: {{ HOSTNAME_CFG01 }}
76 retry: {count: 3, delay: 5}
77 skip_fail: true
78
79
80- description: Install haproxy
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
82 -C 'I@haproxy:proxy' state.sls haproxy
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 3, delay: 5}
85 skip_fail: false
86
87- description: Check haproxy status
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
89 -C 'I@haproxy:proxy' service.status haproxy
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 3, delay: 5}
92 skip_fail: false
93
94- description: Restart rsyslog
95 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
96 -C 'I@haproxy:proxy' service.restart rsyslog
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 3, delay: 5}
99 skip_fail: false
100
101- description: Install memcached on all controllers
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
103 -C 'I@memcached:server' state.sls memcached
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 3, delay: 5}
106 skip_fail: false