blob: b3a1404f998da28009940cb8db16055241e06f76 [file] [log] [blame]
Tatyana Leontovich3c316a12018-01-31 12:42:22 +02001{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
2
3- description: remove apparmor
4 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
5 '*' cmd.run 'service apparmor stop; service apparmor teardown; update-rc.d -f apparmor remove; apt-get -y remove apparmor'
6 node_name: {{ HOSTNAME_CFG01 }}
7 retry: {count: 1, delay: 10}
8 skip_fail: true
9
10# Install support services
11- 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
17
18- description: Install keepalived
19 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
20 -C 'I@keepalived:cluster' state.sls keepalived
21 node_name: {{ HOSTNAME_CFG01 }}
22 retry: {count: 1, delay: 10}
23 skip_fail: true
24
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020025- description: Install glusterfs
26 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
27 -C 'I@glusterfs:server' state.sls glusterfs.server.service
28 node_name: {{ HOSTNAME_CFG01 }}
29 retry: {count: 1, delay: 5}
30 skip_fail: false
31
32- description: Setup glusterfs on primary controller
33 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
34 -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1
35 node_name: {{ HOSTNAME_CFG01 }}
36 retry: {count: 2, delay: 5}
37 skip_fail: false
38
39- description: Check the gluster status
40 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
41 -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1
42 node_name: {{ HOSTNAME_CFG01 }}
43 retry: {count: 1, delay: 5}
44 skip_fail: false
45
46- description: Install RabbitMQ on ctl01
47 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
48 -C 'I@rabbitmq:server and *01*' state.sls rabbitmq
49 node_name: {{ HOSTNAME_CFG01 }}
50 retry: {count: 1, delay: 5}
51 skip_fail: false
52
53- description: Install RabbitMQ
54 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
55 -C 'I@rabbitmq:server' state.sls rabbitmq
56 node_name: {{ HOSTNAME_CFG01 }}
57 retry: {count: 1, delay: 5}
58 skip_fail: false
59
60- description: Check the rabbitmq status
61 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
62 -C 'I@rabbitmq:server' cmd.run 'rabbitmqctl cluster_status'
63 node_name: {{ HOSTNAME_CFG01 }}
64 retry: {count: 1, delay: 5}
65 skip_fail: false
66
67- description: Install Galera on first server
68 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
69 -C 'I@galera:master' state.sls galera
70 node_name: {{ HOSTNAME_CFG01 }}
71 retry: {count: 1, delay: 5}
72 skip_fail: false
73
74- description: Install Galera on other servers
75 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Dennis Dmitrievc6f858c2018-03-13 22:45:22 +020076 -C 'I@galera:slave' state.sls galera -b 1
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020077 node_name: {{ HOSTNAME_CFG01 }}
78 retry: {count: 1, delay: 5}
79 skip_fail: false
80
81- description: Check mysql status
82 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
83 -C 'I@galera:*' mysql.status | grep -A1 -e "wsrep_incoming_addresses\|wsrep_cluster_size"
84 node_name: {{ HOSTNAME_CFG01 }}
85 retry: {count: 1, delay: 5}
86 skip_fail: true
87
88
89- description: Install haproxy
90 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
91 -C 'I@haproxy:proxy' state.sls haproxy
92 node_name: {{ HOSTNAME_CFG01 }}
93 retry: {count: 1, delay: 5}
94 skip_fail: false
95
96- description: Check haproxy status
97 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
98 -C 'I@haproxy:proxy' service.status haproxy
99 node_name: {{ HOSTNAME_CFG01 }}
100 retry: {count: 1, delay: 5}
101 skip_fail: false
102
103- description: Restart rsyslog
104 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
105 -C 'I@haproxy:proxy' service.restart rsyslog
106 node_name: {{ HOSTNAME_CFG01 }}
107 retry: {count: 1, delay: 5}
108 skip_fail: false
109
110- description: Install memcached on all controllers
111 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
112 -C 'I@memcached:server' state.sls memcached
113 node_name: {{ HOSTNAME_CFG01 }}
114 retry: {count: 1, delay: 5}
115 skip_fail: false
Dennis Dmitriev89ba0312018-05-22 14:05:04 +0300116
117- description: Check the VIP
118 cmd: |
119 OPENSTACK_CONTROL_ADDRESS=`salt-call --out=newline_values_only pillar.get _param:openstack_control_address`;
120 echo "_param:openstack_control_address (vip): ${OPENSTACK_CONTROL_ADDRESS}";
121 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}
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 3, delay: 10}
124 skip_fail: false