diff --git a/.config/molecule/Dockerfile b/.config/molecule/Dockerfile index 5986f3bd4..a25d5e0ce 100644 --- a/.config/molecule/Dockerfile +++ b/.config/molecule/Dockerfile @@ -21,15 +21,17 @@ FROM {{ item.registry.url }}/{{ item.image }} FROM {{ item.image }} {% endif %} -RUN dnf makecache && dnf install -y sudo python*-devel python*-dnf bash {{ item.pkg_extras | default('') }} -# TODO(gchamoul): find a better to get always the latest version of those rpms -# below from the centos mirror -RUN dnf install -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-2.el8.noarch.rpm -RUN dnf install -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-repos-8-2.el8.noarch.rpm && dnf install -y epel-release && dnf clean all +RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \ + elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install sudo python*-devel python*-dnf bash epel-release {{ item.pkg_extras | default('') }} && dnf clean all; \ + elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl python-setuptools bash {{ item.pkg_extras | default('') }} && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ + elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml {{ item.pkg_extras | default('') }} && zypper clean -a; \ + elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates {{ item.pkg_extras | default('') }}; \ + elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates {{ item.pkg_extras | default('') }} && xbps-remove -O; fi {% for pkg in item.easy_install | default([]) %} # install pip for centos where there is no python-pip rpm in default repos RUN easy_install {{ pkg }} {% endfor %} + CMD ["sh", "-c", "while true; do sleep 10000; done"] diff --git a/.config/molecule/config.yml b/.config/molecule/config.yml index 7d4fab8d9..924810e44 100644 --- a/.config/molecule/config.yml +++ b/.config/molecule/config.yml @@ -12,9 +12,9 @@ # you will have to redefine them completely in your molecule.yml (at the role # level) and add your extra configuration! # -# For instance, if you need to add an extra package in your ubi8 container, you -# will have to add the entire "platforms" key into your molecule.yml file and -# add your package name in the pkg_extras key. +# For instance, if you need to add an extra package in your CentOS 8 Stream +# container, you will have to add the entire "platforms" key into your +# molecule.yml file and add your package name in the pkg_extras key. # # No merge will happen between your molecule.yml and this config.yml # files. That's why you will have to redefine them completely. @@ -25,11 +25,11 @@ driver: log: true platforms: - - name: ubi8 - hostname: ubi8 - image: ubi8/ubi-init + - name: centos + hostname: centos + image: centos/centos:stream8 registry: - url: registry.access.redhat.com + url: quay.io dockerfile: ../../../../.config/molecule/Dockerfile pkg_extras: python*-setuptools python*-pyyaml volumes: @@ -47,7 +47,7 @@ provisioner: hosts: all: hosts: - ubi8: + centos: ansible_python_interpreter: /usr/bin/python3 log: true options: diff --git a/ansible-collections-requirements.yml b/ansible-collections-requirements.yml index e4971c9d8..66cda28bf 100644 --- a/ansible-collections-requirements.yml +++ b/ansible-collections-requirements.yml @@ -2,4 +2,5 @@ collections: - containers.podman - community.general + - community.crypto - ansible.posix diff --git a/ci/playbooks/pre.yml b/ci/playbooks/pre.yml index 82300333d..5867011df 100644 --- a/ci/playbooks/pre.yml +++ b/ci/playbooks/pre.yml @@ -25,6 +25,13 @@ virtualenv_command: "{{ ensure_pip_virtualenv_command }}" virtualenv_site_packages: true + - name: Set containers module to 3.0 + become: true + shell: | + dnf module disable container-tools:rhel8 -y + dnf module enable container-tools:3.0 -y + dnf clean metadata + - name: Run bindep shell: |- . {{ ansible_user_dir }}/test-python/bin/activate diff --git a/doc/source/contributing/developer_guide.rst b/doc/source/contributing/developer_guide.rst index 7e1581490..6c8297faf 100644 --- a/doc/source/contributing/developer_guide.rst +++ b/doc/source/contributing/developer_guide.rst @@ -579,10 +579,7 @@ Molecule. driver to delegate the task of creating instances. * The ``Platforms`` definitions: Molecule relies on this to know which instances to create, name and to which group each instance - belongs. ``Tripleo-validations`` uses ``Universal Base Images (UBI8)`` which - are container images based on a foundation of Red Hat Enterprise Linux - software. See `Using Red Hat Universal Base Images`_ for details on using Red - Hat UBI container images. + belongs. ``Tripleo-validations`` uses ``CentOS 8 Stream image``. * The ``Provisioner``: Molecule only provides an Ansible provisioner. Ansible manages the life cycle of the instance based on this configuration. * The ``Scenario`` definition: Molecule relies on this configuration to control @@ -591,8 +588,6 @@ Molecule. to write specific stat checking tests (such as deployment smoke tests) on the target instance. -.. _Using Red Hat Universal Base Images: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/building_running_and_managing_containers/index/#using_red_hat_universal_base_images_standard_minimal_and_runtimes - Local testing of new roles -------------------------- diff --git a/roles/check_network_gateway/molecule/default/molecule.yml b/roles/check_network_gateway/molecule/default/molecule.yml index ce5f8f0b9..c7e33ebb9 100644 --- a/roles/check_network_gateway/molecule/default/molecule.yml +++ b/roles/check_network_gateway/molecule/default/molecule.yml @@ -3,11 +3,11 @@ # To override default values, please take a look at the config.yml. platforms: - - name: ubi8 - hostname: ubi8 - image: ubi8/ubi-init + - name: centos + hostname: centos + image: centos/centos:stream8 registry: - url: registry.access.redhat.com + url: quay.io dockerfile: ../../../../.config/molecule/Dockerfile pkg_extras: python*setuptools python*-pyyaml iputils volumes: diff --git a/roles/check_uc_hostname/molecule/default/converge.yml b/roles/check_uc_hostname/molecule/default/converge.yml index 837446eb6..b853b141c 100644 --- a/roles/check_uc_hostname/molecule/default/converge.yml +++ b/roles/check_uc_hostname/molecule/default/converge.yml @@ -46,7 +46,7 @@ include_role: name: check_uc_hostname vars: - check_uc_hostname_inventory_host: ubi8 + check_uc_hostname_inventory_host: centos - name: Working 2 - openstack multiple entry in list copy: @@ -83,7 +83,7 @@ include_role: name: check_uc_hostname vars: - check_uc_hostname_inventory_host: ubi8 + check_uc_hostname_inventory_host: centos - name: Working 3 - openstack multiple entry in list copy: @@ -117,7 +117,7 @@ include_role: name: check_uc_hostname vars: - check_uc_hostname_inventory_host: ubi8 + check_uc_hostname_inventory_host: centos - name: Working 4 - openstack multiple entry in list copy: @@ -149,7 +149,7 @@ include_role: name: check_uc_hostname vars: - check_uc_hostname_inventory_host: ubi8 + check_uc_hostname_inventory_host: centos - name: Failing 1 - we fail if DockerInsecureRegistryAddress is not found copy: @@ -176,7 +176,7 @@ - include_role: name: check_uc_hostname vars: - check_uc_hostname_inventory_host: ubi8 + check_uc_hostname_inventory_host: centos rescue: - name: Clear host errors @@ -219,7 +219,7 @@ - include_role: name: check_uc_hostname vars: - check_uc_hostname_inventory_host: ubi8 + check_uc_hostname_inventory_host: centos rescue: - name: Clear host errors diff --git a/roles/check_uc_hostname/molecule/default/molecule.yml b/roles/check_uc_hostname/molecule/default/molecule.yml index b718ecfd0..6651c40ce 100644 --- a/roles/check_uc_hostname/molecule/default/molecule.yml +++ b/roles/check_uc_hostname/molecule/default/molecule.yml @@ -8,7 +8,7 @@ provisioner: hosts: all: hosts: - ubi8: + centos: ansible_python_interpreter: /usr/bin/python3 vars: plan: qe-Cloud-0 diff --git a/roles/image_serve/molecule/default/molecule.yml b/roles/image_serve/molecule/default/molecule.yml index fd92c9a26..0fe5f15d7 100644 --- a/roles/image_serve/molecule/default/molecule.yml +++ b/roles/image_serve/molecule/default/molecule.yml @@ -3,11 +3,11 @@ # To override default values, please take a look at the config.yml. platforms: - - name: ubi8 - hostname: ubi8 - image: ubi8/ubi-init + - name: centos + hostname: centos + image: centos/centos:stream8 registry: - url: registry.access.redhat.com + url: quay.io etc_hosts: undercloud.ctlplane.mydomain.tld: "127.0.0.1" dockerfile: ../../../../.config/molecule/Dockerfile diff --git a/roles/oslo_config_validator/molecule/default/molecule.yml b/roles/oslo_config_validator/molecule/default/molecule.yml index 7f6ab74ea..dbd5924ba 100644 --- a/roles/oslo_config_validator/molecule/default/molecule.yml +++ b/roles/oslo_config_validator/molecule/default/molecule.yml @@ -11,7 +11,7 @@ provisioner: hosts: all: hosts: - ubi8: + centos: ansible_python_interpreter: /usr/bin/python3 log: true env: diff --git a/roles/oslo_config_validator/molecule/mocked_failure/molecule.yml b/roles/oslo_config_validator/molecule/mocked_failure/molecule.yml index e324d6aaa..e3cd50f92 100644 --- a/roles/oslo_config_validator/molecule/mocked_failure/molecule.yml +++ b/roles/oslo_config_validator/molecule/mocked_failure/molecule.yml @@ -11,7 +11,7 @@ provisioner: hosts: all: hosts: - ubi8: + centos: ansible_python_interpreter: /usr/bin/python3 log: true env: diff --git a/roles/overcloud_service_status/molecule/default/molecule.yml b/roles/overcloud_service_status/molecule/default/molecule.yml index 5ac29d973..ddf28788e 100644 --- a/roles/overcloud_service_status/molecule/default/molecule.yml +++ b/roles/overcloud_service_status/molecule/default/molecule.yml @@ -11,7 +11,7 @@ provisioner: hosts: all: hosts: - ubi8: + centos: ansible_python_interpreter: /usr/bin/python3 overcloud_keystone_url: http://127.0.0.1:8080 overcloud_admin_password: hello diff --git a/roles/overcloud_service_status/molecule/deprecated_services/molecule.yml b/roles/overcloud_service_status/molecule/deprecated_services/molecule.yml index 5ac29d973..ddf28788e 100644 --- a/roles/overcloud_service_status/molecule/deprecated_services/molecule.yml +++ b/roles/overcloud_service_status/molecule/deprecated_services/molecule.yml @@ -11,7 +11,7 @@ provisioner: hosts: all: hosts: - ubi8: + centos: ansible_python_interpreter: /usr/bin/python3 overcloud_keystone_url: http://127.0.0.1:8080 overcloud_admin_password: hello diff --git a/roles/overcloud_service_status/molecule/down_services/molecule.yml b/roles/overcloud_service_status/molecule/down_services/molecule.yml index 5ac29d973..ddf28788e 100644 --- a/roles/overcloud_service_status/molecule/down_services/molecule.yml +++ b/roles/overcloud_service_status/molecule/down_services/molecule.yml @@ -11,7 +11,7 @@ provisioner: hosts: all: hosts: - ubi8: + centos: ansible_python_interpreter: /usr/bin/python3 overcloud_keystone_url: http://127.0.0.1:8080 overcloud_admin_password: hello diff --git a/roles/tls_everywhere/molecule/default/molecule.yml b/roles/tls_everywhere/molecule/default/molecule.yml index 2b655b87f..9eac22e69 100644 --- a/roles/tls_everywhere/molecule/default/molecule.yml +++ b/roles/tls_everywhere/molecule/default/molecule.yml @@ -3,11 +3,11 @@ # To override default values, please take a look at the config.yml. platforms: - - name: ubi8 - hostname: ubi8 - image: ubi8/ubi-init + - name: centos + hostname: centos + image: centos/centos:stream8 registry: - url: registry.access.redhat.com + url: quay.io dockerfile: ../../../../.config/molecule/Dockerfile pkg_extras: python*-setuptools python*-pyyaml krb5-workstation volumes: diff --git a/scripts/run-local-test b/scripts/run-local-test index debd1a0f9..25e3a5e40 100755 --- a/scripts/run-local-test +++ b/scripts/run-local-test @@ -64,6 +64,7 @@ fi PS1="[\u@\h \W]\$" source "${HOME}/test-python/bin/activate" source "${PROJECT_DIR}/ansible-test-env.rc" export ANSIBLE_ROLES_PATH="${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" +ansible-galaxy install -fr "${PROJECT_DIR}/ansible-collections-requirements.yml" ansible-playbook -i "${PROJECT_DIR}/tests/hosts.ini" \ -e "tripleo_src=$(realpath --relative-to="${HOME}" "${PROJECT_DIR}")" \ -e "tripleo_validations_role_name=${ROLE_NAME}" \ diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index 9f53a6036..eaf9fb02d 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -2,7 +2,7 @@ - job: description: Base tripleo-validations job name: tripleo-validations-centos-8-base - nodeset: centos-8 + nodeset: centos-8-stream parent: base success-url: "reports.html" failure-url: "reports.html"