blob: 688f70d5729a08ccd1057cf3f0b114a1bae68616 [file] [log] [blame]
Tatyana Leontovich19a8ca52017-09-08 12:24:28 +03001{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
2
3{% import 'shared-sl-tests.yaml' as SHARED_SL_TESTS with context %}
Tatyana Leontovich126b0032017-08-30 20:51:20 +03004
5# Install docker swarm
6- description: Install keepalived on mon nodes
7 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
8 -C 'mon*' state.sls keepalived
9 node_name: {{ HOSTNAME_CFG01 }}
10 retry: {count: 1, delay: 10}
11 skip_fail: false
12
13- description: Check the VIP on mon nodes
14 cmd: |
15 SL_VIP=`salt-call --out=newline_values_only pillar.get _param:stacklight_monitor_address`;
16 echo "_param:stacklight_monitor_address (vip): ${SL_VIP}";
17 salt --hard-crash --state-output=mixed --state-verbose=False -C 'mon*' cmd.run "ip a | grep ${SL_VIP}" | grep -B1 ${SL_VIP}
18 node_name: {{ HOSTNAME_CFG01 }}
19 retry: {count: 1, delay: 5}
20 skip_fail: false
21
22- description: Configure docker service
23 cmd: salt -C 'I@docker:swarm' state.sls docker.host
24 node_name: {{ HOSTNAME_CFG01 }}
25 retry: {count: 1, delay: 10}
26 skip_fail: false
27
28- description: Install docker swarm on master node
29 cmd: salt -C 'I@docker:swarm:role:master' state.sls docker.swarm
30 node_name: {{ HOSTNAME_CFG01 }}
31 retry: {count: 1, delay: 10}
32 skip_fail: false
33
34- description: Send grains to the swarm slave nodes
35 cmd: salt -C 'I@docker:swarm' state.sls salt.minion.grains
36 node_name: {{ HOSTNAME_CFG01 }}
37 retry: {count: 1, delay: 10}
38 skip_fail: false
39
40- description: Update mine
41 cmd: salt -C 'I@docker:swarm' mine.update
42 node_name: {{ HOSTNAME_CFG01 }}
43 retry: {count: 1, delay: 10}
44 skip_fail: false
45
46- description: Refresh modules
47 cmd: salt -C 'I@docker:swarm' saltutil.refresh_modules; sleep 5;
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 10}
50 skip_fail: false
51
52- description: Rerun swarm on slaves to proper token population
53 cmd: salt -C 'I@docker:swarm:role:master' state.sls docker.swarm
54 node_name: {{ HOSTNAME_CFG01 }}
55 retry: {count: 1, delay: 10}
56 skip_fail: false
57
58- description: Configure slave nodes
59 cmd: salt -C 'I@docker:swarm:role:manager' state.sls docker.swarm -b 1
60 node_name: {{ HOSTNAME_CFG01 }}
61 retry: {count: 1, delay: 10}
62 skip_fail: false
63
64- description: List registered Docker swarm nodes
65 cmd: salt -C 'I@docker:swarm:role:master' cmd.run 'docker node ls'
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 10}
68 skip_fail: false
69
70# Install slv2 infra
71- description: Install telegraf
72 cmd: salt -C 'I@telegraf:agent or I@telegraf:remote_agent' state.sls telegraf
73 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 2, delay: 10}
75 skip_fail: false
76
77- description: Configure Prometheus exporters
78 cmd: salt -C 'I@prometheus:exporters' state.sls prometheus
79 node_name: {{ HOSTNAME_CFG01 }}
80 retry: {count: 1, delay: 10}
81 skip_fail: false
82
83- description: Configure collector
84 cmd: salt -C 'I@heka:log_collector' state.sls heka.log_collector
85 node_name: {{ HOSTNAME_CFG01 }}
86 retry: {count: 1, delay: 10}
87 skip_fail: false
88
89- description: Install elasticsearch server
90 cmd: salt -C 'I@elasticsearch:server' state.sls elasticsearch.server -b 1
91 node_name: {{ HOSTNAME_CFG01 }}
92 retry: {count: 1, delay: 10}
93 skip_fail: false
94
95- description: Install kibana server
96 cmd: salt -C 'I@kibana:server' state.sls kibana.server -b 1
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 1, delay: 10}
99 skip_fail: false
100
101- description: Install elasticsearch client
102 cmd: salt -C 'I@elasticsearch:client' state.sls elasticsearch.client
103 node_name: {{ HOSTNAME_CFG01 }}
104 retry: {count: 1, delay: 10}
105 skip_fail: false
106
107- description: Install kibana client
108 cmd: salt -C 'I@kibana:client' state.sls kibana.client
109 node_name: {{ HOSTNAME_CFG01 }}
110 retry: {count: 1, delay: 10}
111 skip_fail: false
112
113- description: Check influix db
114 cmd: |
115 INFLUXDB_SERVICE=`salt -C 'I@influxdb:server' test.ping 1>/dev/null 2>&1 && echo true`;
116 echo "Influxdb service presence: ${INFLUXDB_SERVICE}";
117 if [[ "$INFLUXDB_SERVICE" == "true" ]]; then
118 salt -C 'I@influxdb:server' state.sls influxdb
119 fi
120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 1, delay: 5}
122 skip_fail: true
123
124# Collect grains needed to configure the services
125
126- description: Get grains
127 cmd: salt -C 'I@salt:minion' state.sls salt.minion.grains
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 10}
130 skip_fail: false
131
132- description: Sync modules
133 cmd: salt -C 'I@salt:minion' saltutil.refresh_modules
134 node_name: {{ HOSTNAME_CFG01 }}
135 retry: {count: 1, delay: 10}
136 skip_fail: false
137
138- description: Update mine
139 cmd: salt -C 'I@salt:minion' mine.update; sleep 5;
140 node_name: {{ HOSTNAME_CFG01 }}
141 retry: {count: 1, delay: 10}
142 skip_fail: false
143
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300144# Configure the services running in Docker Swarm
145- description: Install prometheus alertmanager
146 cmd: salt -C 'I@docker:swarm' state.sls prometheus,heka.remote_collector -b 1
147 node_name: {{ HOSTNAME_CFG01 }}
148 retry: {count: 1, delay: 10}
149 skip_fail: false
150
151- description: run docker state
152 cmd: salt -C 'I@docker:swarm:role:master' state.sls docker
153 node_name: {{ HOSTNAME_CFG01 }}
154 retry: {count: 1, delay: 10}
155 skip_fail: false
156
157- description: docker ps
158 cmd: salt -C 'I@docker:swarm' dockerng.ps
159 node_name: {{ HOSTNAME_CFG01 }}
160 retry: {count: 1, delay: 10}
161 skip_fail: false
162
163- description: Configure Grafana dashboards and datasources
164 cmd: sleep 30; salt -C 'I@grafana:client' state.sls grafana.client
165 node_name: {{ HOSTNAME_CFG01 }}
166 retry: {count: 2, delay: 10}
167 skip_fail: false
168
169- description: Run salt minion to create cert files
170 cmd: salt --hard-crash --state-output=mixed --state-verbose=False "*" state.sls salt.minion
171 node_name: {{ HOSTNAME_CFG01 }}
172 retry: {count: 1, delay: 10}
173 skip_fail: false
174
Tatyana Leontovich19a8ca52017-09-08 12:24:28 +0300175{{ SHARED_SL_TESTS.MACRO_CLONE_SL_TESTS() }}
176{{ SHARED_SL_TESTS.MACRO_CONFIGURE_TESTS() }}