#361 standard-test-source role cannot be installed with ansible-playbook in Fedora 30
Closed: SOLVED by bgoncalv. Opened by fujiwara.

I have the following tests/tests.yml:

- hosts: localhost
  roles:
  - role: standard-test-source
    tags:
    - always
  - role: standard-test-basic
    tags:
    - classic
    required_packages:
    - bash
    tests:
    - smoke1:
        dir: .
        run: ls

When I run ansible-playbook foo/tests/tests.yml, I could not install standard-test-source due to no python2 in Fedora 30.

TASK [standard-test-source : Gather facts] *************************************
[DEPRECATION WARNING]: Distribution fedora 30 on host localhost should use 
/usr/bin/python3, but is using /usr/bin/python for backward compatibility with 
prior Ansible releases. A future Ansible release will default to using the 
discovered platform python for this host. See https://docs.ansible.com/ansible/
2.8/reference_appendices/interpreter_discovery.html for more information. This 
feature will be removed in version 2.12. Deprecation warnings can be disabled 
by setting deprecation_warnings=False in ansible.cfg.
ok: [localhost]
TASK [standard-test-source : Install basic package dependencies] ***************
FAILED - RETRYING: Install basic package dependencies (5 retries left).
FAILED - RETRYING: Install basic package dependencies (4 retries left).
FAILED - RETRYING: Install basic package dependencies (3 retries left).
FAILED - RETRYING: Install basic package dependencies (2 retries left).
FAILED - RETRYING: Install basic package dependencies (1 retries left).
failed: [localhost] (item=rpm-build) => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "ansible_loop_var": "item", "attempts": 5, "changed": false, "cmd": "dnf install -y python2-dnf", "item": "rpm-build", "msg": "Failed to synchronize cache for repo 'mvadkert-beakerlib-libraries'\nIgnoring repositories: mvadkert-beakerlib-libraries\nError: Unable to find a match", "rc": 1, "stderr": "Failed to synchronize cache for repo 'mvadkert-beakerlib-libraries'\nIgnoring repositories: mvadkert-beakerlib-libraries\nError: Unable to find a match\n", "stderr_lines": ["Failed to synchronize cache for repo 'mvadkert-beakerlib-libraries'", "Ignoring repositories: mvadkert-beakerlib-libraries", "Error: Unable to find a match"], "stdout": "Copr repo for beakerlib-libraries owned by mvad 601  B/s | 341  B     00:00    \nLast metadata expiration check: 0:28:12 ago on 201-0-19 15:35:21.\nNo match for argument: python2-dnf\n", "stdout_lines": ["Copr repo for beakerlib-libraries owned by mvad 601  B/s | 341  B     00:00    ", "Last metadata expiration check: 0:28:12 ago on 2019-06-19 15:35:21.", "No match for argument: python2-dnf"]}
PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=1    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0   

Should be fixed in beakerlib-libraries-0.4-2

I updated beakerlib-libraries to 0.4-2.fc30.noarch but I still see the same error of no python2-dnf.

# rpm -q beakerlib-libraries
beakerlib-libraries-0.4-2.fc30.noarch
# ansible-playbook tests.yml
TASK [standard-test-source : Install basic package dependencies] ***************
FAILED - RETRYING: Install basic package dependencies (5 retries left).
FAILED - RETRYING: Install basic package dependencies (4 retries left).
FAILED - RETRYING: Install basic package dependencies (3 retries left).
FAILED - RETRYING: Install basic package dependencies (2 retries left).
FAILED - RETRYING: Install basic package dependencies (1 retries left).
failed: [localhost] (item=rpm-build) => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "ansible_loop_var": "item", "attempts": 5, "changed": false, "cmd": "dnf install -y python2-dnf", "item": "rpm-build", "msg": "Error: Unable to find a match", "rc": 1, "stderr": "Error: Unable to find a match\n", "stderr_lines": ["Error: Unable to find a match"], "stdout": "Last metadata expiration check: 0:15:35 ago on Wed Jun 26 17:00:28 2019.\nNo match for argument: python2-dnf\n", "stdout_lines": ["Last metadata expiration check: 0:15:35 ago on Wed Jun 26 17:00:28 2019.", "No match for argument: python2-dnf"]}
PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=1    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0   

I could resolved the issue with ansible-playbook --extra-vars ansible_python_interpreter=/usr/bin/python3 .

Metadata Update from @astepano:
- Issue assigned to astepano

https://pagure.io/standard-test-roles/pull-request/366 should fix it

I confirmed the #366 resolves this issue.

Metadata Update from @bgoncalv:
- Issue close_status updated to: SOLVED
- Issue status updated to: Closed (was: Open)

Metadata
Related Pull Requests