blob: 2209102a2c178c0c76c162dcfd48fd9bc2fe8707 [file] [log] [blame]
Simon Pasquierd3a0b912017-05-02 15:32:20 +02001#!/bin/bash -x
2exec > >(tee -i /tmp/"$(basename "$0" .sh)"_"$(date '+%Y-%m-%d_%H-%M-%S')".log) 2>&1
3
4# Configure Telegraf
5salt -C 'I@telegraf:agent' state.sls telegraf
6
7# Configure Elasticsearch/Kibana services
8salt -C 'I@elasticsearch:server' state.sls elasticsearch.server -b 1
9salt -C 'I@kibana:server' state.sls kibana.server -b 1
10salt -C 'I@elasticsearch:client' state.sls elasticsearch.client.service
11salt -C 'I@kibana:client' state.sls kibana.client.service
12salt -C 'I@kibana:client or I@elasticsearch:client' --async service.restart salt-minion
13sleep 10
14salt -C 'I@elasticsearch:client' state.sls elasticsearch.client
15salt -C 'I@kibana:client' state.sls kibana.client
16
17# Collect grains needed to configure the services
18salt -C 'I@salt:minion' state.sls salt.minion.grains
19salt -C 'I@salt:minion' saltutil.refresh_modules
20salt -C 'I@salt:minion' mine.update
21sleep 5
22
23# Configure the services running in Docker Swarm
Simon Pasquier59a698d2017-05-04 14:20:15 +020024salt -C 'I@docker:swarm:role:master' state.sls prometheus.server,prometheus.alertmanager
Simon Pasquierd3a0b912017-05-02 15:32:20 +020025for img in pushgateway alertmanager prometheus; do
26 salt -C 'I@docker:swarm' dockerng.pull "docker-sandbox.sandbox.mirantis.net/bkupidura/$img"
27 salt -C 'I@docker:swarm' dockerng.tag "docker-sandbox.sandbox.mirantis.net/bkupidura/$img:latest" "$img:latest"
28done
29salt -C 'I@docker:swarm:role:master' state.sls docker
30salt -C 'I@docker:swarm' dockerng.ps
Simon Pasquierf8532062017-05-04 11:58:41 +020031
32# Configure Grafana dashboards and datasources
33salt -C 'I@grafana:client' state.sls grafana.client.service
34salt -C 'I@grafana:client' --async service.restart salt-minion; sleep 10
35salt -C 'I@grafana:client' state.sls grafana.client