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