Closed afgane closed 6 years ago
I'm not sure why that test is failing? That ansible_distribution
variable is defined when I add a debug
task and target a clean ubuntu 14.04 or 16.04 VM. Any ideas?
I think that's because ansible needs /usr/bin/python to exist, as most commands are wrapped with python on the target. I believe command
is an exception and could work, but http://docs.ansible.com/ansible/latest/faq.html#how-do-i-handle-python-pathing-not-having-a-python-2-x-in-usr-bin-python-on-a-remote-machine does not actually mention what the workaround is.
@afgane My intuition is that the guilty code could be GalaxyKickStart/startup.sh, since the "no-docker" test passes:
maybe this script skips the pre-tasks that you modified as I see that ansible-playbook is launched with a subset of --tags that do not include the pre-tasks. I don't know the default behavior of ansible-playbook with --tags option and whether it run the pre-tasks under these conditions.
Anyway, it could be that the changes you made (in particular gather_facts: False
) reveal this behavior and the ansible_distribution variable is not properly set
Hope it helps
I can also mention that even when the test issue will be fixed, travis is not testing the absence of python-minimal of the target unless you run an apt-get autoremove python. Then if you do that, we will run into the issue mentioned by @mvdbeek since the build is done locally.
@afgane Yep, that's working. See my PR on your PR and https://travis-ci.org/ARTbio/GalaxyKickStart/builds/324611312
Thanks for looking into this; let's see how the tests do now. I was under the impression pre_tasks
run always by default and are not influenced by tags so this is a new one for me.
Yep, you can already see that the set_fact is executed now ;) https://travis-ci.org/ARTbio/GalaxyKickStart/jobs/324640288#L744
👍 One would think that ansible could really have a better mechanism in place for this pretty common case :/.
Thanks @afgane , the playbook is python-independent now... if played from a remote machine with python ;-)
Otherwise, the playbook does not run on a fresh Ubuntu 16.04