blob: 9ec64be58920e9f6557e8c4fb38aaba0850afa54 [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
Tatyana Leontovich126b0032017-08-30 20:51:20 +03006- description: Configure docker service
Dennis Dmitriev281221b2018-02-13 16:40:48 +02007 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@docker:swarm' state.sls docker.host
Tatyana Leontovich126b0032017-08-30 20:51:20 +03008 node_name: {{ HOSTNAME_CFG01 }}
9 retry: {count: 1, delay: 10}
10 skip_fail: false
11
12- description: Install docker swarm on master node
Dennis Dmitriev281221b2018-02-13 16:40:48 +020013 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@docker:swarm:role:master' state.sls docker.swarm
Tatyana Leontovich126b0032017-08-30 20:51:20 +030014 node_name: {{ HOSTNAME_CFG01 }}
15 retry: {count: 1, delay: 10}
16 skip_fail: false
17
18- description: Send grains to the swarm slave nodes
Dennis Dmitriev281221b2018-02-13 16:40:48 +020019 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@docker:swarm' state.sls salt.minion.grains
Tatyana Leontovich126b0032017-08-30 20:51:20 +030020 node_name: {{ HOSTNAME_CFG01 }}
21 retry: {count: 1, delay: 10}
22 skip_fail: false
23
24- description: Update mine
Dennis Dmitriev281221b2018-02-13 16:40:48 +020025 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@docker:swarm' mine.update
Tatyana Leontovich126b0032017-08-30 20:51:20 +030026 node_name: {{ HOSTNAME_CFG01 }}
27 retry: {count: 1, delay: 10}
28 skip_fail: false
29
30- description: Refresh modules
Dennis Dmitriev281221b2018-02-13 16:40:48 +020031 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@docker:swarm' saltutil.refresh_modules; sleep 5;
Tatyana Leontovich126b0032017-08-30 20:51:20 +030032 node_name: {{ HOSTNAME_CFG01 }}
33 retry: {count: 1, delay: 10}
34 skip_fail: false
35
36- description: Rerun swarm on slaves to proper token population
Dennis Dmitriev281221b2018-02-13 16:40:48 +020037 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@docker:swarm:role:master' state.sls docker.swarm
Tatyana Leontovich126b0032017-08-30 20:51:20 +030038 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 10}
40 skip_fail: false
41
42- description: Configure slave nodes
Dennis Dmitriev281221b2018-02-13 16:40:48 +020043 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@docker:swarm:role:manager' state.sls docker.swarm -b 1
Tatyana Leontovich126b0032017-08-30 20:51:20 +030044 node_name: {{ HOSTNAME_CFG01 }}
45 retry: {count: 1, delay: 10}
46 skip_fail: false
47
48- description: List registered Docker swarm nodes
Dennis Dmitriev281221b2018-02-13 16:40:48 +020049 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@docker:swarm:role:master' cmd.run 'docker node ls'
Tatyana Leontovich126b0032017-08-30 20:51:20 +030050 node_name: {{ HOSTNAME_CFG01 }}
51 retry: {count: 1, delay: 10}
52 skip_fail: false
53
Dennis Dmitriev002c2672018-03-06 18:43:27 +020054- description: Install keepalived on mon nodes
55 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
56 -C 'mon*' state.sls keepalived
57 node_name: {{ HOSTNAME_CFG01 }}
58 retry: {count: 1, delay: 10}
59 skip_fail: false
60
61- description: Check the VIP on mon nodes
62 cmd: |
63 SL_VIP=`salt-call --out=newline_values_only pillar.get _param:stacklight_monitor_address`;
64 echo "_param:stacklight_monitor_address (vip): ${SL_VIP}";
65 salt --hard-crash --state-output=mixed --state-verbose=False -C 'mon*' cmd.run "ip a | grep ${SL_VIP}" | grep -B1 ${SL_VIP}
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 5}
68 skip_fail: false
69
Tatyana Leontovich126b0032017-08-30 20:51:20 +030070# Install slv2 infra
71- description: Install telegraf
Dennis Dmitriev281221b2018-02-13 16:40:48 +020072 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@telegraf:agent or I@telegraf:remote_agent' state.sls telegraf
Tatyana Leontovich126b0032017-08-30 20:51:20 +030073 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 2, delay: 10}
75 skip_fail: false
76
77- description: Configure Prometheus exporters
Dennis Dmitriev281221b2018-02-13 16:40:48 +020078 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@prometheus:exporters' state.sls prometheus
Tatyana Leontovich126b0032017-08-30 20:51:20 +030079 node_name: {{ HOSTNAME_CFG01 }}
80 retry: {count: 1, delay: 10}
81 skip_fail: false
82
83- description: Configure collector
Dennis Dmitriev281221b2018-02-13 16:40:48 +020084 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@heka:log_collector' state.sls heka.log_collector
Tatyana Leontovich126b0032017-08-30 20:51:20 +030085 node_name: {{ HOSTNAME_CFG01 }}
86 retry: {count: 1, delay: 10}
87 skip_fail: false
88
89- description: Install elasticsearch server
Dennis Dmitriev281221b2018-02-13 16:40:48 +020090 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@elasticsearch:server' state.sls elasticsearch.server -b 1
Tatyana Leontovich126b0032017-08-30 20:51:20 +030091 node_name: {{ HOSTNAME_CFG01 }}
92 retry: {count: 1, delay: 10}
93 skip_fail: false
94
95- description: Install kibana server
Dennis Dmitriev281221b2018-02-13 16:40:48 +020096 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@kibana:server' state.sls kibana.server -b 1
Tatyana Leontovich126b0032017-08-30 20:51:20 +030097 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 1, delay: 10}
99 skip_fail: false
100
101- description: Install elasticsearch client
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@elasticsearch:client' state.sls elasticsearch.client
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300103 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitriev4ad63e42018-05-01 05:18:54 +0300104 retry: {count: 2, delay: 30}
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300105 skip_fail: false
106
107- description: Install kibana client
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200108 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@kibana:client' state.sls kibana.client
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300109 node_name: {{ HOSTNAME_CFG01 }}
110 retry: {count: 1, delay: 10}
111 skip_fail: false
112
113- description: Check influix db
114 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200115 INFLUXDB_SERVICE=`salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@influxdb:server' test.ping 1>/dev/null 2>&1 && echo true`;
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300116 echo "Influxdb service presence: ${INFLUXDB_SERVICE}";
117 if [[ "$INFLUXDB_SERVICE" == "true" ]]; then
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200118 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@influxdb:server' state.sls influxdb
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300119 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
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200127 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@salt:minion' state.sls salt.minion.grains
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 10}
130 skip_fail: false
131
132- description: Sync modules
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200133 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@salt:minion' saltutil.refresh_modules
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300134 node_name: {{ HOSTNAME_CFG01 }}
135 retry: {count: 1, delay: 10}
136 skip_fail: false
137
138- description: Update mine
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200139 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@salt:minion' mine.update; sleep 5;
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300140 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
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200146 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@docker:swarm' state.sls prometheus,heka.remote_collector -b 1
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300147 node_name: {{ HOSTNAME_CFG01 }}
148 retry: {count: 1, delay: 10}
149 skip_fail: false
150
151- description: run docker state
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200152 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@docker:swarm:role:master' state.sls docker
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300153 node_name: {{ HOSTNAME_CFG01 }}
154 retry: {count: 1, delay: 10}
155 skip_fail: false
156
157- description: docker ps
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200158 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@docker:swarm' dockerng.ps
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300159 node_name: {{ HOSTNAME_CFG01 }}
160 retry: {count: 1, delay: 10}
161 skip_fail: false
162
163- description: Configure Grafana dashboards and datasources
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200164 cmd: sleep 30; salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@grafana:client' state.sls grafana.client
Tatyana Leontovich126b0032017-08-30 20:51:20 +0300165 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() }}