Commit f94709be authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Rafael Monnerat

packer: Fix debian8 image generation

parent 7d326089
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
"accelerator": "kvm", "accelerator": "kvm",
"disk_size": "{{ user `disk_size`}}", "disk_size": "{{ user `disk_size`}}",
"iso_url": "http://cdimage.debian.org/debian-cd/8.3.0/amd64/iso-cd/debian-8.3.0-amd64-netinst.iso", "iso_url": "http://cdimage.debian.org/debian-cd/8.7.1/amd64/iso-cd/debian-8.7.1-amd64-netinst.iso",
"iso_checksum": "a9b490b4215d1e72e876b031dafa7184", "iso_checksum": "453312bf56fc45669fec5ebc0f025ac7",
"iso_checksum_type": "md5", "iso_checksum_type": "md5",
"http_directory": "http", "http_directory": "http",
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
"accelerator": "kvm", "accelerator": "kvm",
"disk_size": "{{ user `disk_size`}}", "disk_size": "{{ user `disk_size`}}",
"iso_url": "http://cdimage.debian.org/debian-cd/8.6.0/amd64/iso-cd/debian-8.6.0-amd64-netinst.iso", "iso_url": "http://cdimage.debian.org/debian-cd/8.7.1/amd64/iso-cd/debian-8.7.1-amd64-netinst.iso",
"iso_checksum": "e9f61bf327db6d8f7cee05a99f2353cc", "iso_checksum": "453312bf56fc45669fec5ebc0f025ac7",
"iso_checksum_type": "md5", "iso_checksum_type": "md5",
"http_directory": "http", "http_directory": "http",
......
...@@ -4,28 +4,28 @@ cat << EOF > /root/run-test ...@@ -4,28 +4,28 @@ cat << EOF > /root/run-test
BOOTSTRAP="/root/start-bootstrap" BOOTSTRAP="/root/start-bootstrap"
FILE="/etc/cron.d/ansible-vm-bootstrap" FILE="/etc/cron.d/ansible-vm-bootstrap"
if [[ ! -f "$BOOTSTRAP" ]] if [[ ! -f "\$BOOTSTRAP" ]]
then then
exit 1 exit 1
fi fi
# Check if playbook has been correctly extracted # Check if playbook has been correctly extracted
COUNT=$(ls /opt/slapos.playbook | wc -l) COUNT=\$(ls /opt/slapos.playbook | wc -l)
if [[ ! $COUNT -gt 1 ]] if [[ ! \$COUNT -gt 1 ]]
then then
rm -f $FILE rm -f \$FILE
rm -f /opt/slapos.playbook/playbook.tar.gz rm -f /opt/slapos.playbook/playbook.tar.gz
fi fi
lf=/tmp/pidLockFile lf=/tmp/pidLockFile
cat /dev/null >> $lf cat /dev/null >> \$lf
read lastPID < $lf read lastPID < \$lf
# if lastPID is not null and a process with that pid exists , exit # if lastPID is not null and a process with that pid exists , exit
[ ! -z "$lastPID" -a -d /proc/$lastPID ] && exit [ ! -z "\$lastPID" -a -d /proc/\$lastPID ] && exit
# save my pid in the lock file # save my pid in the lock file
echo $$ > $lf echo \$\$ > \$lf
if [[ -f "$FILE" ]] && [[ -s "$FILE" ]] && [[ $COUNT -gt 1 ]] if [[ -f "\$FILE" ]] && [[ -s "\$FILE" ]] && [[ \$COUNT -gt 1 ]]
then then
rm /etc/cron.d/vm-boostrap rm /etc/cron.d/vm-boostrap
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment