blob: 5769ddbb0e0e042d753c01acd23aabdb0db15d95 [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
Simon Pasquier7a207ef2017-05-11 12:01:24 +020011salt -C 'I@elasticsearch:client' --async service.restart salt-minion
Simon Pasquierd3a0b912017-05-02 15:32:20 +020012sleep 10
13salt -C 'I@elasticsearch:client' state.sls elasticsearch.client
14salt -C 'I@kibana:client' state.sls kibana.client
15
16# Collect grains needed to configure the services
17salt -C 'I@salt:minion' state.sls salt.minion.grains
18salt -C 'I@salt:minion' saltutil.refresh_modules
19salt -C 'I@salt:minion' mine.update
20sleep 5
21
22# Configure the services running in Docker Swarm
Simon Pasquier59a698d2017-05-04 14:20:15 +020023salt -C 'I@docker:swarm:role:master' state.sls prometheus.server,prometheus.alertmanager
Simon Pasquierd3a0b912017-05-02 15:32:20 +020024for img in pushgateway alertmanager prometheus; do
25 salt -C 'I@docker:swarm' dockerng.pull "docker-sandbox.sandbox.mirantis.net/bkupidura/$img"
26 salt -C 'I@docker:swarm' dockerng.tag "docker-sandbox.sandbox.mirantis.net/bkupidura/$img:latest" "$img:latest"
27done
28salt -C 'I@docker:swarm:role:master' state.sls docker
29salt -C 'I@docker:swarm' dockerng.ps
Simon Pasquierf8532062017-05-04 11:58:41 +020030
31# Configure Grafana dashboards and datasources
Simon Pasquierf8532062017-05-04 11:58:41 +020032salt -C 'I@grafana:client' state.sls grafana.client