#176 test roles do not run if there is no python2 installed
Closed Opened by bgoncalv.

Trying to run tests on Fedora Cloud base qcow2 image will fail because it does not have python2.

# ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory) TEST_SUBJECTS=../Fedora-Cloud-Base-Rawhide-20180415.n.0.x86_64.qcow2 ansible-playbook --tags=classic tests.yml
Launching virtual machine for ../Fedora-Cloud-Base-Rawhide-20180415.n.0.x86_64.qcow2
[DEPRECATION WARNING]: 'include' for playbook includes. You should use 'import_playbook' instead. This feature will be removed in version 2.8. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.
PLAY [localhost] **************************************************************************************************************************************************************************************************
TASK [Gathering Facts] ********************************************************************************************************************************************************************************************
fatal: [../Fedora-Cloud-Base-Rawhide-20180415.n.0.x86_64.qcow2]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 127.0.0.3 closed.\r\n", "module_stdout": "/bin/sh: /usr/bin/python: No such file or directory\r\n", "msg": "MODULE FAILURE", "rc": 0}
    to retry, use: --limit @/tmp/bgoncalv/gzip/tests.retry
PLAY RECAP ********************************************************************************************************************************************************************************************************
../Fedora-Cloud-Base-Rawhide-20180415.n.0.x86_64.qcow2 : ok=0    changed=0    unreachable=0    failed=1

As workaround add --extra-vars ansible_python_interpreter=/usr/bin/python3 to the command line

Note: Docker inventory does not have this problem as it forces python2 to be installed, this could also be an issue for releases that do not ship python2 any more.


--tags=classic means : test-runner == test-environment

standard-test-roles.spec has next entry:

Requires: ansible

If Ansible cannot invoke its own modules that it is Ansible bug.

Could you please without STR on this host run ping module ?

~ ansible -i localhost, all -m ping
localhost | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}

I think this is Ansible / Python bug.

Please also run:

alternatives --config python
alternatives --list | grep -i python

The issue you filled is against rawhide. Do you know why they do not set alternative by default to python3? We need some official statement about Python alternatives. For me it seems like a Rawhide issue. https://fedoraproject.org/wiki/Alternatives_system

This is due the new Fedora guildelines for python.

https://fedoraproject.org/wiki/Packaging:Python

There is a bug: https://bugzilla.redhat.com/show_bug.cgi?id=1567995 let's wait for answer.

http://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html?highlight=implicit%20localhost#implicit-localhost

It seems that our approach with explicit localhost forces as to define ansible_python_interpreter.

For qcow2 inventory script code is fixed at : #178

For container inventory script code is fixed at #179

Metadata Update from @astepano:
- Issue status updated to: Closed (was: Open)

Metadata