blob: 5a4fe256a85a715cec29a198fa19e69b6fb2fcee [file] [log] [blame]
sgudz8c888ec2017-10-02 15:29:23 +03001{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
sgudzcced67d2017-10-11 15:56:09 +03002{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_KVM01 with context %}
3{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_KVM02 with context %}
4{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_KVM03 with context %}
5
6
7- description: (REMOVE asap) Hack KVMs of Hash sum mismatch
8 cmd: |
9 rm -rf /var/lib/apt/lists/*;
10 apt-get clean;
11 apt-get update;
12 node_name: {{ HOSTNAME_KVM01 }}
13 retry: {count: 1, delay: 5}
14 skip_fail: true
15
16- description: (REMOVE asap) Hack KVMs of Hash sum mismatch
17 cmd: |
18 rm -rf /var/lib/apt/lists/*;
19 apt-get clean;
20 apt-get update;
21 node_name: {{ HOSTNAME_KVM02 }}
22 retry: {count: 1, delay: 5}
23 skip_fail: true
24
25- description: (REMOVE asap) Hack KVMs of Hash sum mismatch
26 cmd: |
27 rm -rf /var/lib/apt/lists/*;
28 apt-get clean;
29 apt-get update;
30 node_name: {{ HOSTNAME_KVM03 }}
31 retry: {count: 1, delay: 5}
32 skip_fail: true
33
34- 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: sleep 30; 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 }}
45 retry: {count: 2, delay: 30}
46 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
sgudz8c888ec2017-10-02 15:29:23 +030054
55# Install support services
56- description: Install keepalived on ctl01
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
58 -C 'I@keepalived:cluster and *01*' state.sls keepalived
59 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 10}
61 skip_fail: true
62
63- description: Install keepalived
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
65 -C 'I@keepalived:cluster' state.sls keepalived
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 10}
68 skip_fail: true
69
70- description: Check the OpenStack control VIP
71 cmd: |
72 OPENSTACK_CONTROL_ADDRESS=$(salt --out=newline_values_only "ctl01*" pillar.get _param:cluster_vip_address);
73 echo "_param:cluster_vip_address (vip): ${OPENSTACK_CONTROL_ADDRESS}";
74 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}
75 node_name: {{ HOSTNAME_CFG01 }}
76 retry: {count: 1, delay: 5}
77 skip_fail: false
78
sgudz8c888ec2017-10-02 15:29:23 +030079- description: Install RabbitMQ on ctl01
80 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
81 -C 'I@rabbitmq:server and *01*' state.sls rabbitmq
82 node_name: {{ HOSTNAME_CFG01 }}
83 retry: {count: 1, delay: 5}
84 skip_fail: false
85
86- description: Install RabbitMQ
87 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
88 -C 'I@rabbitmq:server' state.sls rabbitmq
89 node_name: {{ HOSTNAME_CFG01 }}
90 retry: {count: 1, delay: 5}
91 skip_fail: false
92
93- description: Check the rabbitmq status
94 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
95 -C 'I@rabbitmq:server' cmd.run 'rabbitmqctl cluster_status'
96 node_name: {{ HOSTNAME_CFG01 }}
97 retry: {count: 1, delay: 5}
98 skip_fail: false
99
100- description: Install Galera on first server
101 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
102 -C 'I@galera:master' state.sls galera
103 node_name: {{ HOSTNAME_CFG01 }}
104 retry: {count: 1, delay: 5}
105 skip_fail: false
106
107- description: Install Galera on other servers
108 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
109 -C 'I@galera:slave' state.sls galera
110 node_name: {{ HOSTNAME_CFG01 }}
111 retry: {count: 1, delay: 5}
112 skip_fail: false
113
114- description: Check mysql status
115 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
116 -C 'I@galera:*' mysql.status | grep -A1 -e "wsrep_incoming_addresses\|wsrep_cluster_size"
117 node_name: {{ HOSTNAME_CFG01 }}
118 retry: {count: 1, delay: 5}
119 skip_fail: true
120
121
122- description: Install haproxy
123 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
124 -C 'I@haproxy:proxy' state.sls haproxy
125 node_name: {{ HOSTNAME_CFG01 }}
126 retry: {count: 1, delay: 5}
127 skip_fail: false
128
129- description: Check haproxy status
130 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
131 -C 'I@haproxy:proxy' service.status haproxy
132 node_name: {{ HOSTNAME_CFG01 }}
133 retry: {count: 1, delay: 5}
134 skip_fail: false
135
136- description: Install nginx on prx nodes
137 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
138 -C 'I@nginx:server' state.sls nginx
139 node_name: {{ HOSTNAME_CFG01 }}
140 retry: {count: 1, delay: 5}
141 skip_fail: false
142
143- description: Restart rsyslog
144 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
145 -C 'I@haproxy:proxy' service.restart rsyslog
146 node_name: {{ HOSTNAME_CFG01 }}
147 retry: {count: 1, delay: 5}
148 skip_fail: false
149
150- description: Install memcached on all controllers
151 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
152 -C 'I@memcached:server' state.sls memcached
153 node_name: {{ HOSTNAME_CFG01 }}
154 retry: {count: 1, delay: 5}
155 skip_fail: false