#!/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