Modified OpenStack build settings for mirror-image

Change-Id: Ie59ff1de60f4807a9b39b358834f19cbfac0b652
diff --git a/mirror-image/scripts/cleanup.sh b/mirror-image/scripts/cleanup.sh
index 295d4cb..857c7d9 100644
--- a/mirror-image/scripts/cleanup.sh
+++ b/mirror-image/scripts/cleanup.sh
@@ -23,3 +23,5 @@
 echo "cleaning up minion_id for salt"
 rm -f /etc/salt/minion_id || true
 
+echo "cleaning up resolvconf"
+sed -i '/172\.18\.208\.44/d' /etc/resolvconf/resolv.conf.d/base
\ No newline at end of file
diff --git a/mirror-image/scripts/mirrors.sh b/mirror-image/scripts/mirrors.sh
index 23bd679..fe7101f 100644
--- a/mirror-image/scripts/mirrors.sh
+++ b/mirror-image/scripts/mirrors.sh
@@ -1,15 +1,19 @@
 #!/bin/bash -xe
-#docker registry
-salt-call -t 5 --retcode-passthrough --no-color state.sls docker.host
-#docker run --restart always -d -p 5000:5000 --name registry registry:2
-salt-call -t 5 --retcode-passthrough state.sls docker.client.registry
-#docker system prune --all --force
 
 #aptly
+salt-call -t 5 --no-color state.sls aptly.server
+salt-call -t 5 --no-color state.sls aptly.publisher
 salt-call -t 5 --no-color state.sls aptly
-salt-call -t 5 --retcode-passthrough --no-color state.sls aptly.server
-sudo -i -u aptly aptly_mirror_update.sh -sv
-sudo -i -u aptly aptly_publish_update.sh -acrfv
+salt-call -t 5 --retcode-passthrough --no-color state.sls aptly
+aptly_mirror_update.sh -sv
+aptly-publisher --url http://10.99.0.1:18084 --timeout=1200 publish -v -d -c /etc/aptly-publisher.yaml --architectures amd64 --recreate --force-overwrite
+
+#docker registry
+salt-call -t 5 --retcode-passthrough state.sls docker.client.registry
+docker system prune --all --force
+
+#debmirror
+salt-call -t 5 --no-color state.sls debmirror
 
 #git
 salt-call -t 5 --retcode-passthrough --no-color state.sls git.server
diff --git a/mirror-image/scripts/reboot.sh b/mirror-image/scripts/reboot.sh
new file mode 100644
index 0000000..52adc95
--- /dev/null
+++ b/mirror-image/scripts/reboot.sh
@@ -0,0 +1,2 @@
+pgrep -f "sshd: root@" | xargs kill -9
+reboot now
\ No newline at end of file
diff --git a/mirror-image/scripts/salt.sh b/mirror-image/scripts/salt.sh
index 9c8a837..879c250 100644
--- a/mirror-image/scripts/salt.sh
+++ b/mirror-image/scripts/salt.sh
@@ -10,5 +10,6 @@
 salt-call -t 5 --retcode-passthrough --no-color state.sls linux.system.file
 salt-call -t 5 --retcode-passthrough --no-color state.sls docker.host
 salt-call -t 5 --retcode-passthrough --no-color state.sls docker exclude=docker.client.registry
+sleep 120
 salt-call -t 5 --retcode-passthrough --no-color state.sls linux.network
 salt-call -t 5 --retcode-passthrough --no-color state.sls nginx
diff --git a/mirror-image/scripts/salt_bootstrap.sh b/mirror-image/scripts/salt_bootstrap.sh
index 8dec3ce..453c3fb 100644
--- a/mirror-image/scripts/salt_bootstrap.sh
+++ b/mirror-image/scripts/salt_bootstrap.sh
@@ -5,7 +5,7 @@
 SALTSTACK_GPG=${SALTSTACK_GPG:-"https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3/SALTSTACK-GPG-KEY.pub"}
 SALTSTACK_REPO=${SALTSTACK_REPO:-"http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3 xenial main"}
 APT_MIRANTIS_GPG=${APT_MIRANTIS_GPG:-"http://apt.mirantis.com/public.gpg"}
-APT_MIRANTIS_SALT_REPO=${APT_MIRANTIS_SALT_REPO:-"http://apt.mirantis.com/xenial/ ${FORMULA_VERSION} salt"}
+APT_MIRANTIS_SALT_REPO=${APT_MIRANTIS_SALT_REPO:-"http://apt.mirantis.com/xenial/ $FORMULA_VERSION salt"}
 GIT_SALT_FORMULAS_SCRIPTS=${GIT_SALT_FORMULAS_SCRIPTS:-"https://github.com/salt-formulas/salt-formulas-scripts"}
 
 wget -O - ${SALTSTACK_GPG} | sudo apt-key add -