blob: d99c834e37375bf23ac4d2a0bef927a69604db69 [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
42- description: Check the OpenStack control VIP
43 cmd: |
44 OPENSTACK_CONTROL_ADDRESS=$(salt --out=newline_values_only "ctl01*" pillar.get _param:cluster_vip_address);
45 echo "_param:cluster_vip_address (vip): ${OPENSTACK_CONTROL_ADDRESS}";
46 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}
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 5}
49 skip_fail: false
50
51- description: Install RabbitMQ on ctl01
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
53 -C 'I@rabbitmq:server and *01*' state.sls rabbitmq
54 node_name: {{ HOSTNAME_CFG01 }}
55 retry: {count: 1, delay: 5}
56 skip_fail: false
57
58- description: Install RabbitMQ
59 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
60 -C 'I@rabbitmq:server' state.sls rabbitmq
61 node_name: {{ HOSTNAME_CFG01 }}
62 retry: {count: 1, delay: 5}
63 skip_fail: false
64
65- description: Check the rabbitmq status
66 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
67 -C 'I@rabbitmq:server' cmd.run 'rabbitmqctl cluster_status'
68 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 1, delay: 5}
70 skip_fail: false
71
72- description: Install Galera on first server
73 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
74 -C 'I@galera:master' state.sls galera
75 node_name: {{ HOSTNAME_CFG01 }}
76 retry: {count: 1, delay: 5}
77 skip_fail: false
78
79- description: Install Galera on other servers
80 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
81 -C 'I@galera:slave' state.sls galera -b 1
82 node_name: {{ HOSTNAME_CFG01 }}
83 retry: {count: 1, delay: 5}
84 skip_fail: false
85
86- description: Check mysql status
87 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
88 -C 'I@galera:*' mysql.status | grep -A1 -e "wsrep_incoming_addresses\|wsrep_cluster_size"
89 node_name: {{ HOSTNAME_CFG01 }}
90 retry: {count: 1, delay: 5}
91 skip_fail: true
92
93- description: Install haproxy
94 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
95 -C 'I@haproxy:proxy' state.sls haproxy
96 node_name: {{ HOSTNAME_CFG01 }}
97 retry: {count: 1, delay: 5}
98 skip_fail: false
99
100- description: Check haproxy status
101 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
102 -C 'I@haproxy:proxy' service.status haproxy
103 node_name: {{ HOSTNAME_CFG01 }}
104 retry: {count: 1, delay: 5}
105 skip_fail: false
106
107- description: Install nginx on prx nodes
108 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
109 -C 'I@nginx:server' state.sls nginx
110 node_name: {{ HOSTNAME_CFG01 }}
111 retry: {count: 1, delay: 5}
112 skip_fail: false
113
114- description: Restart rsyslog
115 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
116 -C 'I@haproxy:proxy' service.restart rsyslog
117 node_name: {{ HOSTNAME_CFG01 }}
118 retry: {count: 1, delay: 5}
119 skip_fail: false
120
121- description: Install memcached on all controllers
122 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
123 -C 'I@memcached:server' state.sls memcached
124 node_name: {{ HOSTNAME_CFG01 }}
125 retry: {count: 1, delay: 5}
126 skip_fail: false