summaryrefslogtreecommitdiff
path: root/files/ci
diff options
context:
space:
mode:
authorCarlos Konstanski <ckonstanski@pippiandcarlos.com>2017-11-13 16:50:55 -0700
committerCarlos Konstanski <ckonstanski@pippiandcarlos.com>2017-11-13 16:50:55 -0700
commitffa2a169ea98fb54a29d90ca158059e79e2816ba (patch)
tree018461d031b71178fa48b9672d8e39bac4de1270 /files/ci
initial commit
Diffstat (limited to 'files/ci')
-rwxr-xr-xfiles/ci/cloudcfg.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/files/ci/cloudcfg.sh b/files/ci/cloudcfg.sh
new file mode 100755
index 0000000..f7dffd6
--- /dev/null
+++ b/files/ci/cloudcfg.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Prepare the instance for ansible. This amounts to installing python2.
+
+python=$(which python || which python3 || which python2 || false)
+
+case "$(${python} -m platform)" in
+ *Ubuntu*)
+ export DEBIAN_FRONTEND=noninteractive
+ apt-get update
+ apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade
+ apt-get -y install python python2.7
+ ;;
+ *centos*|*redhat*)
+ # RHEL systems still use python2 by default; nothing to do
+ ;;
+ *gentoo*)
+ if [ ! -d /usr/portage/sys-devel/gcc ]; then
+ emerge-webrsync
+ fi
+ emerge --oneshot --update dev-lang/python:2.7 app-portage/gentoolkit
+ ;;
+esac
+
+exit 0