Fix ubuntu image update failures. 67/61267/2
authorAnil Belur <abelur@linuxfoundation.org>
Mon, 7 Aug 2017 11:02:41 +0000 (21:02 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Mon, 7 Aug 2017 21:23:40 +0000 (07:23 +1000)
public_cloud: E: Unable to fetch some archives, maybe run apt-get update
or try with --fix-missing?

Change-Id: I7e049a5e79372c3a4e81d0cada26dcfc40330ede
Jira: releng-368
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
packer/provision/baseline.sh

index 8aca86314e02d110e5c5ab5fe05d19b1f77f942e..852761030a5a8449c57a64b71eb07ebd9831fd67 100644 (file)
@@ -288,18 +288,18 @@ EOF
     # add additional repositories
     sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
 
-    # facter is not installed by default on the base image and facter package
-    # gets removed when puppet4 is updated. To fix this use version of facter
-    # shipped with puppet4.
-    ensure_ubuntu_install facter
-    # ensure facter is available in $PATH avoid failures in retry loop
-    export PATH="/opt/puppetlabs/bin/:$PATH"
-
     echo "---> Installing base packages"
     apt-get clean
     apt-get update -m
     apt-get upgrade -m
     apt-get dist-upgrade -m
+    apt-get install facter
+
+    # facter is not installed by default on the base image and facter package
+    # gets removed when puppet4 is updated. To fix this use version of facter
+    # shipped with puppet4.
+    # ensure facter is available in $PATH avoid failures in retry loop
+    export PATH="/opt/puppetlabs/bin/:$PATH"
 
     ensure_ubuntu_install unzip xz-utils git libxml-xpath-perl