blob: af8172283225ea2000743d980a66b72fe200d7d6 [file] [log] [blame]
Dennis Dmitrieveea5bb32017-09-03 23:20:54 +03001{% from 'cookied-mcp-ocata-dvr-vxlan/underlay.yaml' import HOSTNAME_CFG01 with context %}
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +03002
Dennis Dmitrievc035c242017-10-06 17:12:08 +03003- description: Refresh grains
4 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' state.sls salt.minion.grains
5 node_name: {{ HOSTNAME_CFG01 }}
6 retry: {count: 1, delay: 15}
7 skip_fail: false
8
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +03009# Install support services
10- description: Install keepalived on ctl01
11 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
12 -C 'I@keepalived:cluster and *01*' state.sls keepalived
13 node_name: {{ HOSTNAME_CFG01 }}
14 retry: {count: 1, delay: 10}
15 skip_fail: true
16
17- description: Install keepalived
18 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
19 -C 'I@keepalived:cluster' state.sls keepalived
20 node_name: {{ HOSTNAME_CFG01 }}
21 retry: {count: 1, delay: 10}
22 skip_fail: true
23
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +030024- description: Install glusterfs
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
26 -C 'I@glusterfs:server' state.sls glusterfs.server.service
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 1, delay: 5}
29 skip_fail: false
30
31- description: Setup glusterfs on primary controller
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
33 -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1
34 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitrieva95a6d42017-10-24 15:09:04 +030035 retry: {count: 2, delay: 5}
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +030036 skip_fail: false
37
38- description: Check the gluster status
39 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
40 -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 1, delay: 5}
43 skip_fail: false
44
45- description: Install RabbitMQ on ctl01
46 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
47 -C 'I@rabbitmq:server and *01*' state.sls rabbitmq
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 5}
50 skip_fail: false
51
52- description: Install RabbitMQ
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@rabbitmq:server' state.sls rabbitmq
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 1, delay: 5}
57 skip_fail: false
58
59- description: Check the rabbitmq status
60 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
61 -C 'I@rabbitmq:server' cmd.run 'rabbitmqctl cluster_status'
62 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 1, delay: 5}
64 skip_fail: false
65
66- description: Install Galera on first server
67 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
68 -C 'I@galera:master' state.sls galera
69 node_name: {{ HOSTNAME_CFG01 }}
70 retry: {count: 1, delay: 5}
71 skip_fail: false
72
73- description: Install Galera on other servers
74 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Dennis Dmitrievc6f858c2018-03-13 22:45:22 +020075 -C 'I@galera:slave' state.sls galera -b 1
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +030076 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 1, delay: 5}
78 skip_fail: false
79
80- description: Check mysql status
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
82 -C 'I@galera:*' mysql.status | grep -A1 -e "wsrep_incoming_addresses\|wsrep_cluster_size"
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 1, delay: 5}
85 skip_fail: true
86
87
88- description: Install haproxy
89 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
90 -C 'I@haproxy:proxy' state.sls haproxy
91 node_name: {{ HOSTNAME_CFG01 }}
92 retry: {count: 1, delay: 5}
93 skip_fail: false
94
95- description: Check haproxy status
96 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
97 -C 'I@haproxy:proxy' service.status haproxy
98 node_name: {{ HOSTNAME_CFG01 }}
99 retry: {count: 1, delay: 5}
100 skip_fail: false
101
Dennis Dmitrievc7b17312017-10-01 00:08:11 +0300102- description: Run salt minion to create cert files for nginx
103 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
104 -C 'I@nginx:server' state.sls salt.minion
105 node_name: {{ HOSTNAME_CFG01 }}
106 retry: {count: 1, delay: 10}
107 skip_fail: false
108
Dennis Dmitriev910a8002017-08-31 14:53:47 +0300109- description: Install nginx on prx nodes
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
111 -C 'I@nginx:server' state.sls nginx
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 5}
114 skip_fail: false
115
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +0300116- description: Restart rsyslog
117 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
118 -C 'I@haproxy:proxy' service.restart rsyslog
119 node_name: {{ HOSTNAME_CFG01 }}
120 retry: {count: 1, delay: 5}
121 skip_fail: false
122
123- description: Install memcached on all controllers
124 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
125 -C 'I@memcached:server' state.sls memcached
126 node_name: {{ HOSTNAME_CFG01 }}
127 retry: {count: 1, delay: 5}
128 skip_fail: false
Dennis Dmitriev89ba0312018-05-22 14:05:04 +0300129
130- description: Check the VIP
131 cmd: |
132 OPENSTACK_CONTROL_ADDRESS=`salt-call --out=newline_values_only pillar.get _param:openstack_control_address`;
133 echo "_param:openstack_control_address (vip): ${OPENSTACK_CONTROL_ADDRESS}";
134 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}
135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 3, delay: 10}
137 skip_fail: false