bootstrap ansible fails on clean ubuntu 16.04

Bug #1704546 reported by Jean-Philippe Evrard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Critical
Jesse Pretorius

Bug Description

When bootstraping ansible on master (AIO, ubuntu 16.04), we install python3-all python3-dev, ...

However, when I enter the get_pip function, doing:
``python /opt/get-pip.py pip==9.0.1 setuptools==36.2.0 wheel==0.29.0``
I get:
``scripts/scripts-library.sh: line 265: python: command not found``

Expected, because:
``
root@ubuntu-xenial:/vagrant/openstack-ansible# python
The program 'python' can be found in the following packages:
 * python-minimal
 * python3
Try: apt install <selected package>
``

In other words, we install python3-all python3-dev, etc... But we never ensure the freshly installed python3 is the default interpreter. I don't think that setting python3 as a default interpreter is a good idea.

However, this doesn't work, as is. We should, as much as possible be explicit, or at least alias python=python3 in the script.

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

Setting an alias fixes the get_pip script, however it would still fail in the
``ansible-playbook get-ansible-role-requirements.yml -i /vagrant/openstack-ansible/tests/test-inventory.ini -e role_file=/vagrant/openstack-ansible/ansible-role-requirements.yml``

description: updated
Changed in openstack-ansible:
assignee: nobody → Jesse Pretorius (jesse-pretorius)
Changed in openstack-ansible:
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (master)

Fix proposed to branch: master
Review: https://review.openstack.org/485127

Changed in openstack-ansible:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (master)

Reviewed: https://review.openstack.org/485127
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=1f80d9c8ed13a5fb9ff83bc3fab1105e59f0873b
Submitter: Jenkins
Branch: master

commit 1f80d9c8ed13a5fb9ff83bc3fab1105e59f0873b
Author: Jesse Pretorius <email address hidden>
Date: Wed Jul 19 10:37:09 2017 +0100

    Add python package for ansible bootstrap

    In the current ansible bootstrap script, python3 is
    exclusively installed resulting in there being no
    symlink for /usr/bin/python to the appropriate
    python binary. This causes failures for anything
    which relies on using the 'python' command (instead
    of python3), resulting in failure if the python
    packages was not previously installed in some other
    way.

    Installing the 'python-minimal' package results in
    python2 being installed and symlinked, but it does
    not cause the Ansible venv to be bootstrapped any
    differently - it still uses python3 and the venv
    is setup with a symlink from python -> python3.

    We therefore include the 'python-minimal' package
    in the bootstrap so that anything that needs access
    to the python binary can still work. In the future
    Ubuntu may change where it symlinks to, but by
    then all our tooling should be capable of using
    the new python version.

    Closes-Bug: #1704546
    Change-Id: I13f70040a0a3b4d1c9434078aa6d6888abf45787

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 16.0.0.0b3

This issue was fixed in the openstack/openstack-ansible 16.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.