Switching bootstrap to local repos

The patch switches bootstrap process to deploy
packages from local repos mirror.mirantis.com

Related-PROD: PROD-25276

Depends-On: I0e2ffe085c297b510c6bac45ff39667689a1df0d
Change-Id: Ia6eda46c01c11889d9ac46f80a4db3a285357496
diff --git a/bootstrap.sh b/bootstrap.sh
index c59db0b..a8124a0 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -52,8 +52,10 @@
 test -e /etc/lsb-release && eval $(cat /etc/lsb-release)
 which lsb_release && DISTRIB_CODENAME=${DISTRIB_CODENAME:-$(lsb_release -cs)}
 #
-export APT_REPOSITORY=${APT_REPOSITORY:- deb [arch=amd64] http://apt.mirantis.com/${DISTRIB_CODENAME} ${DISTRIB_REVISION:-stable} salt}
-export APT_REPOSITORY_GPG=${APT_REPOSITORY_GPG:-http://apt.mirantis.com/public.gpg}
+export MCP_SALT_REPO=${MCP_SALT_REPO:-deb [arch=amd64] http://apt.mirantis.com/${DISTRIB_CODENAME} ${DISTRIB_REVISION:-stable} salt}
+export APT_REPOSITORY=${APT_REPOSITORY:-${MCP_SALT_REPO}}
+export MCP_SALT_REPO_KEY=${MCP_SALT_REPO_KEY:-http://apt.mirantis.com/public.gpg}
+export APT_REPOSITORY_GPG=${APT_REPOSITORY_GPG:-${MCP_SALT_REPO_KEY}}
 # reclass
 export RECLASS_ADDRESS=${RECLASS_ADDRESS:-https://github.com/salt-formulas/openstack-salt.git} # https/git
 export RECLASS_BRANCH=${RECLASS_BRANCH:-master}
@@ -87,6 +89,7 @@
 export SA_IGNORE_ERROR_SALT_MASTER_ENV=${SA_IGNORE_ERROR_SALT_MASTER_ENV:-False}
 
 # saltstack
+#
 BOOTSTRAP_SALTSTACK=${BOOTSTRAP_SALTSTACK:-True}
 BOOTSTRAP_SALTSTACK_COM=${BOOTSTRAP_SALTSTACK_COM:-"https://bootstrap.saltstack.com"}
 BOOTSTRAP_SALTSTACK_VERSION=${BOOTSTRAP_SALTSTACK_VERSION:- stable 2017.7 }
@@ -94,7 +97,7 @@
 # TODO add 'r' option by default
 # Currently, without 'r' option, upstream saltstack repos will be used. Otherwise
 # local one should be used, from http://apt.mirantis.com/ or whatever.
-BOOTSTRAP_SALTSTACK_OPTS=${BOOTSTRAP_SALTSTACK_OPTS:- -dX $BOOTSTRAP_SALTSTACK_VERSION }
+BOOTSTRAP_SALTSTACK_OPTS=${BOOTSTRAP_SALTSTACK_OPTS:- -dXr $BOOTSTRAP_SALTSTACK_VERSION }
 SALT_SOURCE=${SALT_SOURCE:-pkg}
 
 # SECURITY
@@ -150,15 +153,11 @@
 
 configure_pkg_repo()
 {
-
     case $PLATFORM_FAMILY in
       debian)
           if [ -n "$APT_REPOSITORY_PPA" ]; then
             which add-apt-repository || $SUDO apt-get install -y software-properties-common
             $SUDO add-apt-repository -y ppa:${APT_REPOSITORY_PPA}
-          else
-            echo -e  "$APT_REPOSITORY " | $SUDO tee /etc/apt/sources.list.d/mcp_salt.list >/dev/null
-            curl -sL $APT_REPOSITORY_GPG | $SUDO apt-key add -
           fi
           $SUDO apt-get clean
           $SUDO apt-get update