diff --git a/install_puppet.sh b/install_puppet.sh index decc648c4e..f99388ebe9 100755 --- a/install_puppet.sh +++ b/install_puppet.sh @@ -232,11 +232,6 @@ EOF fi dpkg -i $puppet_deb rm $puppet_deb - - # ansible also requires python2 on the host to run correctly. - # Make sure we have it, as some images come without it - DEBIAN_FRONTEND=noninteractive apt-get --option 'Dpkg::Options::=--force-confold' \ - --assume-yes install python-minimal fi; apt-get update @@ -329,6 +324,16 @@ function setup_pip { pip install -U setuptools } +# Need to install python2 early as pip and ansible need it and it +# isn't necessarily previously installed on newer Ubuntu releases. +if is_ubuntu; then + if ! which python > /dev/null 2<&1 ; then + DEBIAN_FRONTEND=noninteractive apt-get update + DEBIAN_FRONTEND=noninteractive apt-get --option 'Dpkg::Options::=--force-confold' \ + --assume-yes install -y --force-yes python-minimal + fi +fi + if $SETUP_PIP; then setup_pip fi