blob: a637ebfcf72086cad611b7a7b7dd944b2daf0ecb [file] [log] [blame]
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +03001{% from 'virtual-mcp11-k8s-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
2
3# Install support services
4- description: Create and distribute SSL certificates for services using salt state
5 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' state.sls salt
6 node_name: {{ HOSTNAME_CFG01 }}
7 retry: {count: 1, delay: 10}
8 skip_fail: true
9
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +030010- description: Install glusterfs
11 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
12 -C 'I@glusterfs:server' state.sls glusterfs.server.service
13 node_name: {{ HOSTNAME_CFG01 }}
14 retry: {count: 1, delay: 5}
15 skip_fail: false
16
17- description: Setup glusterfs on primary controller
18 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
19 -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1
20 node_name: {{ HOSTNAME_CFG01 }}
21 retry: {count: 1, delay: 5}
22 skip_fail: false
23
24- description: Check the gluster status
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
26 -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 1, delay: 5}
29 skip_fail: false
30
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030031- description: Install keepalived
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
33 -C 'I@keepalived:cluster' state.sls keepalived -b 1
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 1, delay: 10}
36 skip_fail: true
37
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030038- description: Install haproxy
39 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
40 -C 'I@haproxy:proxy' state.sls haproxy
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 1, delay: 5}
43 skip_fail: false
44
45- description: Install haproxy.service
46 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
47 -C 'I@haproxy:proxy' service.status haproxy
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 5}
50 skip_fail: false
51
52- description: Install docker
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@docker:host' state.sls docker.host
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 1, delay: 5}
57 skip_fail: false
58
59- description: Check docker
60 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
61 -C 'I@docker:host' cmd.run 'docker ps'
62 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 1, delay: 5}
64 skip_fail: false
65
66- description: Install etcd
67 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
68 -C 'I@etcd:server' state.sls etcd.server.service
69 node_name: {{ HOSTNAME_CFG01 }}
70 retry: {count: 1, delay: 5}
71 skip_fail: false
72
73- description: Check the etcd health
74 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
75 -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 1, delay: 5}
78 skip_fail: false
79
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +030080- description: Install k8s
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030081 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
82 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons;
83 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@kubernetes:pool' state.sls kubernetes.pool;
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030084 node_name: {{ HOSTNAME_CFG01 }}
85 retry: {count: 1, delay: 5}
86 skip_fail: false
87
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +030088- description: Setup etcd server
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030089 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +030090 -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup;
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030091 node_name: {{ HOSTNAME_CFG01 }}
92 retry: {count: 1, delay: 5}
93 skip_fail: false
94
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +030095- description: Run master without setup
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030096 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
97 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
98 node_name: {{ HOSTNAME_CFG01 }}
99 retry: {count: 1, delay: 5}
100 skip_fail: true
101
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300102- description: Run master setup
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300103 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300104 -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup
105 node_name: {{ HOSTNAME_CFG01 }}
106 retry: {count: 1, delay: 5}
107 skip_fail: true
108
109- description: Restart kubelet
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
111 -C 'I@kubernetes:pool' service.restart kubelet
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 5}
114 skip_fail: false
115
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300116# install contrail
117- description: Install contrail db
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300118 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300119 -C 'I@opencontrail:database' state.sls opencontrail.database
120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 2, delay: 20}
122 skip_fail: false
123
124- description: Install contrail control
125 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
126 -C 'I@opencontrail:control' state.sls opencontrail
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300127 node_name: {{ HOSTNAME_CFG01 }}
128 retry: {count: 1, delay: 5}
129 skip_fail: false
130
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300131- description: Install contrail control with exclude client on node 1
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300132 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300133 -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
134 node_name: {{ HOSTNAME_CFG01 }}
135 retry: {count: 1, delay: 5}
136 skip_fail: false
137
138- description: Install contrail control with exclude client on all nodes
139 cmd: salt --hard-crash --state-output=mixed --state-verbose=Falsa
140 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
141 node_name: {{ HOSTNAME_CFG01 }}
142 retry: {count: 1, delay: 5}
143 skip_fail: false
144
145- description: Install contrail collector without contrail client
146 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
147 -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
148 node_name: {{ HOSTNAME_CFG01 }}
149 retry: {count: 1, delay: 5}
150 skip_fail: false
151
152- description: Check contrail status
153 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
154 -C 'I@opencontrail:control' cmd.run contrail-status
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 1, delay: 5}
157 skip_fail: false
158
159# install contrail computes
160- description: Configure contrail
161 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
162 -C 'I@opencontrail:database:id:1' state.sls opencontrail.client
163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 1, delay: 5}
165 skip_fail: false
166
167- description: Provision vrouter
168 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
169 -C 'I@nova:compute' cmd.run 'exec 0>&-; exec 1>&-; exec 2>&-; nohup bash -c "ip link | grep vhost && echo no_reboot || sleep 5 && reboot & "'
170 node_name: {{ HOSTNAME_CFG01 }}
171 retry: {count: 1, delay: 5}
172 skip_fail: false
173
174- description: Compute contrail client on cmp
175 cmd: slepp 300; salt --hard-crash --state-output=mixed --state-verbose=False
176 -C 'I@opencontrail:compute' state.sls opencontrail.client
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300177 node_name: {{ HOSTNAME_CFG01 }}
178 retry: {count: 1, delay: 5}
179 skip_fail: false