Fix info-drop scripts
Change-Id: Ia7fca90465bbb97db6fc94b1cedc780bdae65e4f
diff --git a/common/ubuntu_cleanup_salt.sh b/common/ubuntu_cleanup_salt.sh
index 69509b5..da01a28 100644
--- a/common/ubuntu_cleanup_salt.sh
+++ b/common/ubuntu_cleanup_salt.sh
@@ -1,16 +1,8 @@
#!/bin/bash -xe
# Duplicate of ubuntu_info.sh
-mkdir -p /var/log/bootstrap_logs/
-pushd /var/log/bootstrap_logs/
- dpkg-query -W -f='${Package}=${Version}\n' | sort -u |tee -a vcp_initial_pkgs.log
- # Drop some reclass info,if available
- if [[ $(which salt-key) ]] ; then
- for node in $(salt-key -l acc | grep -v 'Accepted Keys:') ; do
- salt ${node} pillar.data --out=json > ${node}.pillardata.json || true
- reclass -n ${node} -o json > ${node}.reclass.json || true
- done
- fi
+mkdir -p /var/log/bootstrap_logs/ ; pushd /var/log/bootstrap_logs/
+ dpkg-query -W -f='${Package}=${Version}\n' |tee -a vcp_initial_pkgs_stage_salt.log
popd
apt-get purge -y salt-formula-*
diff --git a/common/ubuntu_info.sh b/common/ubuntu_info.sh
index 3fc2cf9..3e4a0a5 100644
--- a/common/ubuntu_info.sh
+++ b/common/ubuntu_info.sh
@@ -2,10 +2,6 @@
# Save some basic debug information.
-mkdir -p /var/log/bootstrap_logs/
-pushd /var/log/bootstrap_logs/
+mkdir -p /var/log/bootstrap_logs/ ; pushd /var/log/bootstrap_logs/
dpkg-query -W -f='${Package}=${Version}\n' | sort -u |tee -a vcp_initial_pkgs.log
- # In case, salt_cleanup or other have been processed
- sort -u vcp_initial_pkgs.log >> vcp_initial_pkgs.log_tmp
- mv -v vcp_initial_pkgs.log_tmp vcp_initial_pkgs.log
popd
diff --git a/day01-image/scripts/salt.sh b/day01-image/scripts/salt.sh
index 78cdd79..7e58372 100644
--- a/day01-image/scripts/salt.sh
+++ b/day01-image/scripts/salt.sh
@@ -44,3 +44,13 @@
sleep 60
salt-call ${SALT_OPTS} state.sls jenkins.client
+# Duplicate of ubuntu_info.sh
+mkdir -p /var/log/bootstrap_logs/ ; pushd /var/log/bootstrap_logs/
+ # Drop some reclass info,if available
+ if [[ $(which salt-key) ]] ; then
+ for node in $(salt-key -l acc | grep -v 'Accepted Keys:') ; do
+ salt ${node} pillar.data --out=json > ${node}.pillardata.json || true
+ reclass -n ${node} -o json > ${node}.reclass.json || true
+ done
+ fi
+popd
diff --git a/mirror-image/scripts/salt.sh b/mirror-image/scripts/salt.sh
index ea3d147..fa6eed6 100644
--- a/mirror-image/scripts/salt.sh
+++ b/mirror-image/scripts/salt.sh
@@ -18,3 +18,14 @@
salt-call ${SALT_OPTS} state.sls linux.network
salt-call ${SALT_OPTS} state.sls nginx
salt-call ${SALT_OPTS} state.sls maas.mirror
+
+# Duplicate of ubuntu_info.sh
+mkdir -p /var/log/bootstrap_logs/ ; pushd /var/log/bootstrap_logs/
+ # Drop some reclass info,if available
+ if [[ $(which salt-key) ]] ; then
+ for node in $(salt-key -l acc | grep -v 'Accepted Keys:') ; do
+ salt ${node} pillar.data --out=json > ${node}.pillardata.json || true
+ reclass -n ${node} -o json > ${node}.reclass.json || true
+ done
+ fi
+popd