From 7cab8996742b8128bed197f9457afd2af160cf5e Mon Sep 17 00:00:00 2001 From: Carlos Konstanski Date: Wed, 30 Oct 2019 14:33:05 -0600 Subject: initial commit --- salt/gentoo_baseimage/ci/files/cloudcfg.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 salt/gentoo_baseimage/ci/files/cloudcfg.sh (limited to 'salt/gentoo_baseimage/ci/files/cloudcfg.sh') diff --git a/salt/gentoo_baseimage/ci/files/cloudcfg.sh b/salt/gentoo_baseimage/ci/files/cloudcfg.sh new file mode 100644 index 0000000..400f7cf --- /dev/null +++ b/salt/gentoo_baseimage/ci/files/cloudcfg.sh @@ -0,0 +1,29 @@ +#!/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 aptitude python python2.7 python3-netaddr ntp ntpdate language-pack-de + update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 + update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1 + update-alternatives --set python /usr/bin/python3.6 + ;; + *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 net-misc/chrony + rc-update add chrony default + ;; +esac + +exit 0 -- cgit v1.3