lae / ansible-role-travis-lxc

Ansible role that prepares a Travis CI environment and creates LXC containers for testing roles.
MIT License
4 stars 2 forks source link

Issue using role with Python != 2.7 #28

Closed SebTM closed 6 years ago

SebTM commented 6 years ago

Hello,

I would like to use your role for testing - my build-matrix has different ansible and python-versions. It seems to be hardcoded here (https://github.com/lae/ansible-role-travis-lxc/blob/v0.7.2/tasks/travis_packaging_setup.yml) to use Python 2.7.

Could you readout that with a which or something?

Best Regards

lae commented 6 years ago

I'm still reading so might figure this out later, but do you have any idea how I can specify a build matrix to ONLY run one test for a different Python version?

Current config: https://github.com/lae/ansible-role-travis-lxc/blob/v0.7.2/.travis.yml

I'd want to just test with one of the env items instead of doubling the build time by testing all of them.

lae commented 6 years ago

Just commenting for awareness - this is in master but I'm working on trying to get Ubuntu Bionic support in before I cut a new release.

lae commented 6 years ago

Release 0.7.3 has been cut

SebTM commented 6 years ago

I would need to reopen this issue:

https://travis-ci.com/SebTM/ansible-common As you can see here, Python 2.6 is failling on "TASK [ansible-role-travis-lxc : Install the python-apt library from local source] *" While Python 3.5/3.6 is failing on "TASK [ansible-role-travis-lxc : Install LXC Python library] **"

Could you tell me what's wrong?

lae commented 6 years ago

The version of python-apt for Trusty and above have a dependency on python-all-dev >= 2.7. I don't think I can support Python 2.6.

Your build is telling me that the Python 3 builds are trying to install the Python 2 LXC library instead of the Python 3 one, and I'm not sure why right now.

SebTM commented 6 years ago

Thx for your response :) Okay, no problem with 2.6 - I will drop the support for this - was just experimental.

Would be nice if you could have a deeper look at it if you have time. I'm also a bit lost why it's not working at my repository espacially as it works in your tests.

lae commented 6 years ago

I'm not able to reproduce here https://travis-ci.org/lae/ansible-role-travis-lxc/builds/376919607

I forked your repository to debug the ansible_python var so maybe that'll shed some light.

lae commented 6 years ago

It appears to be the result of specifying an inventory containing localhost - which for some reason causes ansible to use /usr/bin/python instead of the virtualenv's python in travis https://github.com/lae/ansible-common/compare/1d4270d52596...998de7971d3d

SebTM commented 6 years ago

Hey, thanks for your help so far - but I was unable to fix it with this. What I tried:

It fails on both times at task "TASK [lae.travis-lxc : Install libapt-pkg-dev as build dependency for python-apt] ***"

Would be nice if you could have another look at it :) (https://travis-ci.com/SebTM/ansible-common/jobs/123544886)

lae commented 6 years ago

Don't merge my branch, I changed way too much.

Your repository before my fork should work now, I believe, thanks to https://github.com/lae/ansible-role-travis-lxc/commit/4f5f547a319c402fa6b990069b7cc076872d30b9.

lae commented 6 years ago

Yeah, this build seems to indicate that your existing test setup prior to reopening this issue works (current master, I'll tag a release after the local user feature, since the inventory/ansible defaulting to /usr/bin/python instead of Travis' virtualenv's Python issue isn't present for anyone following docs as-is).

https://travis-ci.org/lae/ansible-common/builds/376966420