Update packer config to work in Vexxhost
[releng/builder.git] / packer / provision / docker.sh
index 23b1fc042c0a9e78e8c9bfd346afe8f5bd0df2b8..12814a6f213bccc1304aa95c1c227d6457b78a7b 100644 (file)
@@ -2,6 +2,9 @@
 
 # vim: sw=4 ts=4 sts=4 et :
 
+# force any errors to cause the script and job to end in failure
+set -xeu -o pipefail
+
 rh_changes() {
     echo "---> RH changes"
     # install docker and enable it
@@ -21,18 +24,21 @@ EOL
 
     # docker group doesn't get created by default for some reason
     groupadd docker
+
+    # Install python dependencies
+    yum install -y python-{devel,virtualenv,setuptools,pip}
 }
 
 ubuntu_changes() {
     echo "---> Ubuntu changes"
 }
 
-OS=$(/usr/bin/facter operatingsystem)
+OS=$(/usr/bin/facter operatingsystem | tr '[:upper:]' '[:lower:]')
 case "$OS" in
-    CentOS|Fedora|RedHat)
+    centos|fedora|redhat)
         rh_changes
     ;;
-    Ubuntu)
+    ubuntu)
         ubuntu_changes
     ;;
     *)