summaryrefslogtreecommitdiffstats
path: root/packer/provision/baseline.sh
diff options
context:
space:
mode:
Diffstat (limited to 'packer/provision/baseline.sh')
-rw-r--r--packer/provision/baseline.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/packer/provision/baseline.sh b/packer/provision/baseline.sh
index 68a16226f..ca79868aa 100644
--- a/packer/provision/baseline.sh
+++ b/packer/provision/baseline.sh
@@ -115,6 +115,8 @@ Dpkg::Options {
EOF
+ chmod +x /usr/local/bin/apt-get
+
echo "---> Updating operating system"
apt-get update
apt-get upgrade
@@ -137,9 +139,23 @@ EOF
# make sure that we still default to openjdk 7
update-alternatives --set java /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
update-alternatives --set javac /usr/lib/jvm/java-7-openjdk-amd64/bin/javac
+
+ # disable auto-update service?
+ if [ -f /etc/cron.daily/apt ]
+ then
+ rm -rf /etc/cron.daily/apt
+ fi
;;
16.04)
apt-get install openjdk-8-jdk
+
+ # force auto-update services off and mask them so they can't
+ # be started
+ for i in apt-daily.{service,timer}
+ do
+ systemctl disable ${i}
+ systemctl mask ${i}
+ done
;;
*)
echo "---> Unknown Ubuntu version $FACTER_OSVER"
@@ -155,8 +171,8 @@ EOF
# disable unattended upgrades & daily updates
echo '---> Disabling automatic daily upgrades'
- sed -ine 's/"1"/"0"/g' /etc/apt/apt.conf.d/10periodic
- echo 'APT::Periodic::Unattended-Upgrade "0";' >> /etc/apt/apt.conf.d/10periodic
+ grep -lR 'APT::Periodic' /etc/apt/apt.conf.d/ | perl -pi -e 's/"1"/"0"/g'
+
}
all_systems() {