metadata:
description: 'Detect whether the repositories listed in `yum repolist` can be connected
to and that there is at least one repo configured.
Detect if there are any unwanted repositories (such as EPEL) enabled.
'
groups:
- pre-upgrade
name: Check correctness of current repositories
driver:
name: podman
log: true
platforms:
- dockerfile: Dockerfile
environment:
http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
hostname: ubi8
image: ubi8/ubi-init
name: ubi8
pkg_extras: python*-setuptools
privileged: true
registry:
url: registry.access.redhat.com
ulimits:
- host
volumes:
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
- /etc/pki/rpm-gpg:/etc/pki/rpm-gpg
- /opt/yum.repos.d:/etc/yum.repos.d:rw
provisioner:
env:
ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}
ANSIBLE_STDOUT_CALLBACK: yaml
inventory:
hosts:
all:
hosts:
ubi8:
ansible_python_interpreter: /usr/bin/python3
log: true
name: ansible
scenario:
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- destroy
verifier:
name: testinfra
hosts:
all:
hosts:
ubi8:
ansible_python_interpreter: /usr/bin/python3
- hosts: all
name: Converge
tasks:
- include_role:
name: repos
name: test role without failure
- block:
- name: inject faulty repository
yum_repository:
baseurl: http://this.repository.do-not.exists/like-not-at-all
description: really faulty repository
enabled: true
name: faulty
- include_role:
name: repos
name: execute role
name: run with failure
rescue:
- meta: clear_host_errors
name: clean host error
- debug:
msg: Successfully detected first broken repository
name: Molecule output
- block:
- name: remove faulty repository
yum_repository:
name: faulty
state: absent
- name: push another faulty repository with working DNS
yum_repository:
baseurl: http://download.fedoraproject.org/pub/fedora/blah
description: faulty repository with working DNS
enabled: true
name: faulty-bis
- include_role:
name: repos
name: execute role
name: run with another failure
rescue:
- meta: clear_host_errors
name: clean host error
- debug:
msg: Successfully detected second faulty repository. Exiting!
name: Molecule output
- meta: end_play
name: End play
- fail:
msg: 'The repos validation failed detecting broken/non-working repository
'
name: Fail the test
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.