Deploy InfluxDB for Prometheus remote storage
This change deploys the InfluxDB service on the mon nodes of
virtual-mcp11-{dvr,contrail,k8s-calico,k8s-contrail}. InfluxDB will be
used by Prometheus for long-term storage.
Change-Id: Ibfb2dd08e539dbd0bb73ef03713f5f0d77d7da40
diff --git a/scripts/stacklightv2_infra_install.sh b/scripts/stacklightv2_infra_install.sh
index 5794978..79b9881 100755
--- a/scripts/stacklightv2_infra_install.sh
+++ b/scripts/stacklightv2_infra_install.sh
@@ -11,6 +11,8 @@
fi
. "$COMMONS"
+INFLUXDB_SERVICE=$(salt -C 'I@influxdb:server' test.ping 1>/dev/null 2>&1 && echo true)
+
# Configure Telegraf
salt -C 'I@telegraf:agent' state.sls telegraf
@@ -23,6 +25,10 @@
salt -C 'I@elasticsearch:client' state.sls elasticsearch.client
salt -C 'I@kibana:client' state.sls kibana.client
+if [[ "$INFLUXDB_SERVICE" == "true" ]]; then
+ salt -C 'I@influxdb:server' state.sls influxdb
+fi
+
# Collect grains needed to configure the services
salt -C 'I@salt:minion' state.sls salt.minion.grains
salt -C 'I@salt:minion' saltutil.refresh_modules