blob: 7daf069c658084c6e3fab8d117c100166b791397 [file] [log] [blame]
Dennis Dmitrievab83ea42017-05-12 16:52:45 +03001{% from 'virtual-mcp11-ovs/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
34
35- description: Install glusterfs
36 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
37 -C 'I@glusterfs:server' state.sls glusterfs.server.service
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 5}
40 skip_fail: false
41
42- description: Setup glusterfs on primary controller
43 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
44 -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1
45 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovicha5230212017-09-27 14:43:06 +030046 retry: {count: 2, delay: 20}
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030047 skip_fail: false
48
49- description: Check the gluster status
50 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
51 -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1
52 node_name: {{ HOSTNAME_CFG01 }}
53 retry: {count: 1, delay: 5}
54 skip_fail: false
55
Tatyana Leontovich86851a22017-04-25 21:25:26 +030056- description: Install RabbitMQ on ctl01
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
58 -C 'I@rabbitmq:server and *01*' state.sls rabbitmq
59 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 5}
61 skip_fail: false
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030062
63- description: Install RabbitMQ
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich86851a22017-04-25 21:25:26 +030065 -C 'I@rabbitmq:server' state.sls rabbitmq
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030066 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 5}
68 skip_fail: false
69
70- description: Check the rabbitmq status
71 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
72 -C 'I@rabbitmq:server' cmd.run 'rabbitmqctl cluster_status'
73 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 1, delay: 5}
75 skip_fail: false
76
77- description: Install Galera on first server
78 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
79 -C 'I@galera:master' state.sls galera
80 node_name: {{ HOSTNAME_CFG01 }}
81 retry: {count: 1, delay: 5}
82 skip_fail: false
83
84- description: Install Galera on other servers
85 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Dennis Dmitrievc6f858c2018-03-13 22:45:22 +020086 -C 'I@galera:slave' state.sls galera -b 1
Tatyana Leontovichd8bf14f2017-04-19 12:20:50 +030087 node_name: {{ HOSTNAME_CFG01 }}
88 retry: {count: 1, delay: 5}
89 skip_fail: false
90
91- description: Check mysql status
92 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
93 -C 'I@galera:*' mysql.status | grep -A1 -e "wsrep_incoming_addresses\|wsrep_cluster_size"
94 node_name: {{ HOSTNAME_CFG01 }}
95 retry: {count: 1, delay: 5}
96 skip_fail: true
97
98
99- description: Install haproxy
100 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
101 -C 'I@haproxy:proxy' state.sls haproxy
102 node_name: {{ HOSTNAME_CFG01 }}
103 retry: {count: 1, delay: 5}
104 skip_fail: false
105
106- description: Check haproxy status
107 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
108 -C 'I@haproxy:proxy' service.status haproxy
109 node_name: {{ HOSTNAME_CFG01 }}
110 retry: {count: 1, delay: 5}
111 skip_fail: false
112
113- description: Restart rsyslog
114 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
115 -C 'I@haproxy:proxy' service.restart rsyslog
116 node_name: {{ HOSTNAME_CFG01 }}
117 retry: {count: 1, delay: 5}
118 skip_fail: false
119
120- description: Install memcached on all controllers
121 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
122 -C 'I@memcached:server' state.sls memcached
123 node_name: {{ HOSTNAME_CFG01 }}
124 retry: {count: 1, delay: 5}
125 skip_fail: false