blob: 82664ec9880b11f2fd3ef9c20aa760eab58f70d6 [file] [log] [blame]
Dennis Dmitrievab83ea42017-05-12 16:52:45 +03001{% from 'virtual-mcp11-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +03002
3# Install support services
Tatyana Leontovicha5230212017-09-27 14:43:06 +03004- description: sync time
5 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
6 'service ntp stop; ntpd -gq; service ntp start'
7 node_name: {{ HOSTNAME_CFG01 }}
8 retry: {count: 1, delay: 30}
Tatyana Leontovich5cab58b2017-09-27 16:22:48 +03009 skip_fail: true
Tatyana Leontovicha5230212017-09-27 14:43:06 +030010
Tatyana Leontovichfc976b82017-04-25 20:46:13 +030011- description: Install keepalived on ctl01
12 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
13 -C 'I@keepalived:cluster and *01*' state.sls keepalived
14 node_name: {{ HOSTNAME_CFG01 }}
15 retry: {count: 1, delay: 10}
16 skip_fail: true
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030017
18- description: Install keepalived
19 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichfc976b82017-04-25 20:46:13 +030020 -C 'I@keepalived:cluster' state.sls keepalived
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030021 node_name: {{ HOSTNAME_CFG01 }}
22 retry: {count: 1, delay: 10}
23 skip_fail: true
24
25- description: Check the VIP
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030026 cmd: |
27 OPENSTACK_CONTROL_ADDRESS=`salt-call --out=newline_values_only pillar.get _param:openstack_control_address`;
28 echo "_param:openstack_control_address (vip): ${OPENSTACK_CONTROL_ADDRESS}";
29 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keepalived:cluster' cmd.run "ip a | grep ${OPENSTACK_CONTROL_ADDRESS}" | grep -B1 ${OPENSTACK_CONTROL_ADDRESS}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030030 node_name: {{ HOSTNAME_CFG01 }}
31 retry: {count: 1, delay: 5}
32 skip_fail: false
33
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030034- description: Install glusterfs
35 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
36 -C 'I@glusterfs:server' state.sls glusterfs.server.service
37 node_name: {{ HOSTNAME_CFG01 }}
38 retry: {count: 1, delay: 5}
39 skip_fail: false
40
41- description: Setup glusterfs on primary controller
42 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
43 -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1
44 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovichc3b7d722017-09-27 15:07:16 +030045 retry: {count: 2, delay: 20}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030046 skip_fail: false
47
48- description: Check the gluster status
49 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
50 -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1
51 node_name: {{ HOSTNAME_CFG01 }}
52 retry: {count: 1, delay: 5}
53 skip_fail: false
54
Tatyana Leontovich86851a22017-04-25 21:25:26 +030055- description: Install RabbitMQ on ctl01
56 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
57 -C 'I@rabbitmq:server and *01*' state.sls rabbitmq
58 node_name: {{ HOSTNAME_CFG01 }}
59 retry: {count: 1, delay: 5}
60 skip_fail: false
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030061
62- description: Install RabbitMQ
63 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich86851a22017-04-25 21:25:26 +030064 -C 'I@rabbitmq:server' state.sls rabbitmq
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030065 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
67 skip_fail: false
68
69- description: Check the rabbitmq status
70 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
71 -C 'I@rabbitmq:server' cmd.run 'rabbitmqctl cluster_status'
72 node_name: {{ HOSTNAME_CFG01 }}
73 retry: {count: 1, delay: 5}
74 skip_fail: false
75
76- description: Install Galera on first server
77 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
78 -C 'I@galera:master' state.sls galera
79 node_name: {{ HOSTNAME_CFG01 }}
80 retry: {count: 1, delay: 5}
81 skip_fail: false
82
83- description: Install Galera on other servers
84 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
85 -C 'I@galera:slave' state.sls galera
86 node_name: {{ HOSTNAME_CFG01 }}
87 retry: {count: 1, delay: 5}
88 skip_fail: false
89
90- description: Check mysql status
91 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
92 -C 'I@galera:*' mysql.status | grep -A1 -e "wsrep_incoming_addresses\|wsrep_cluster_size"
93 node_name: {{ HOSTNAME_CFG01 }}
94 retry: {count: 1, delay: 5}
95 skip_fail: true
96
97
98- description: Install haproxy
99 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
100 -C 'I@haproxy:proxy' state.sls haproxy
101 node_name: {{ HOSTNAME_CFG01 }}
102 retry: {count: 1, delay: 5}
103 skip_fail: false
104
105- description: Check haproxy status
106 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
107 -C 'I@haproxy:proxy' service.status haproxy
108 node_name: {{ HOSTNAME_CFG01 }}
109 retry: {count: 1, delay: 5}
110 skip_fail: false
111
112- description: Restart rsyslog
113 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
114 -C 'I@haproxy:proxy' service.restart rsyslog
115 node_name: {{ HOSTNAME_CFG01 }}
116 retry: {count: 1, delay: 5}
117 skip_fail: false
118
119- description: Install memcached on all controllers
120 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
121 -C 'I@memcached:server' state.sls memcached
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 1, delay: 5}
124 skip_fail: false