Fix installation scripts for StackLight

The change ensures that log_collector and remote_collector are
installed. It also removes unnecessary steps and moves the installation
of StackLight at the end of the workflow to make sure that all the
monitored services are deployed.

It also uses the Docker images from the Mirantis internal registry.

Change-Id: Id53507856098d0282f8b90e5d9aca5a362e97de7
diff --git a/scripts/bootstrap_all.sh b/scripts/bootstrap_all.sh
index 4e4d248..445464e 100755
--- a/scripts/bootstrap_all.sh
+++ b/scripts/bootstrap_all.sh
@@ -16,9 +16,6 @@
 if [[ "$K8S_BOOTSTRAP" == "true" ]]; then
     "$CWD"/kubernetes_install.sh
 fi
-if [[ "$STACKLIGHTV2_BOOTSTRAP" == "true" ]]; then
-    "$CWD"/stacklightv2_infra_install.sh
-fi
 if [[ "$OPENSTACK_BOOTSTRAP" == "true" ]]; then
     "$CWD"/openstack_control_install.sh
     "$CWD"/stacklight_infra_install.sh
@@ -30,3 +27,6 @@
     fi
     "$CWD"/stacklight_monitor_install.sh
 fi
+if [[ "$STACKLIGHTV2_BOOTSTRAP" == "true" ]]; then
+    "$CWD"/stacklightv2_infra_install.sh
+fi
diff --git a/scripts/stacklightv2_infra_install.sh b/scripts/stacklightv2_infra_install.sh
index 08cb962..8ce538a 100755
--- a/scripts/stacklightv2_infra_install.sh
+++ b/scripts/stacklightv2_infra_install.sh
@@ -14,14 +14,14 @@
 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
+salt -C 'I@telegraf:agent or I@telegraf:remote_agent' state.sls telegraf
+
+# Configure log_collector
+salt -C 'I@heka:log_collector' state.sls heka.log_collector
 
 # Configure Elasticsearch/Kibana services
 salt -C 'I@elasticsearch:server' state.sls elasticsearch.server -b 1
 salt -C 'I@kibana:server' state.sls kibana.server -b 1
-salt -C 'I@elasticsearch:client' state.sls elasticsearch.client.service
-salt -C 'I@elasticsearch:client' --async service.restart salt-minion
-sleep 10
 salt -C 'I@elasticsearch:client' state.sls elasticsearch.client
 salt -C 'I@kibana:client' state.sls kibana.client
 
@@ -35,16 +35,14 @@
 salt -C 'I@salt:minion' mine.update
 sleep 5
 
-# Configure the services running in Docker Swarm
-salt -C 'I@docker:swarm' state.sls prometheus.server,prometheus.alertmanager -b 1
-for img in pushgateway alertmanager prometheus telegraf remote_storage_adapter; do
-    salt -C 'I@docker:swarm' dockerng.pull "docker-sandbox.sandbox.mirantis.net/bkupidura/$img"
-    salt -C 'I@docker:swarm' dockerng.tag "docker-sandbox.sandbox.mirantis.net/bkupidura/$img:latest" "mirantis/$img:latest"
-done
+# Generate the configuration for services running in Docker Swarm
+salt -C 'I@docker:swarm' state.sls prometheus,heka.remote_collector -b 1
+
+# Kick off the services in Docker Swarm
 salt -C 'I@docker:swarm:role:master' state.sls docker
 salt -C 'I@docker:swarm' dockerng.ps
 
-# Configure Grafana dashboards and datasources
+# Configure the Grafana dashboards and datasources
 stacklight_vip=$(get_param_value stacklight_monitor_address)
 wait_for_http_service "http://${stacklight_vip}:15013/"
 salt -C 'I@grafana:client' state.sls grafana.client