From 74f2f8187054dc10e1bbff50feba2b5abfc7b2a4 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Thu, 16 Apr 2020 17:39:50 -0500 Subject: [PATCH] Convert docker molecule usage to podman This change updates all uses of docker to podman and removes our docker installation process from zuul and our local test process. Some container based tests have been moved to "delegated" becuase they no longer make sense to run in a container and the hacks needed to maintain the container based testing are not worth maintaining for podman. Change-Id: I02de94a1229bfa847f14ecf282eadbcfe6396875 Signed-off-by: Kevin Carter --- _skeleton_role_/molecule/default/molecule.yml | 5 +- bindep.txt | 1 + molecule-requirements.txt | 1 - scripts/run-local-test | 4 + tools/test-setup.sh | 8 -- tox.ini | 2 +- .../roles/aide/molecule/default/molecule.yml | 5 +- .../backup_and_restore/defaults/main.yml | 2 +- .../molecule/default/Dockerfile | 37 ---------- .../molecule/default/converge.yml | 2 - .../molecule/default/molecule.yml | 2 + .../molecule/default/prepare.yml | 68 +++++------------ .../login_defs/molecule/default/molecule.yml | 5 +- .../test_deps/molecule/default/molecule.yml | 5 +- .../roles/test_deps/tasks/tripleo-setup.yml | 3 + .../molecule/default/molecule.yml | 5 +- .../molecule/negative/molecule.yml | 5 +- .../molecule/positive/molecule.yml | 5 +- .../molecule/default/Dockerfile | 37 ---------- .../molecule/default/converge.yml | 1 + .../molecule/default/molecule.yml | 69 ++++++------------ .../roles/tripleo_bootstrap/tasks/main.yml | 4 +- .../molecule/default/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../tripleo_container_rm/defaults/main.yml | 2 +- .../molecule/default/converge.yml | 9 +-- .../molecule/default/molecule.yml | 8 +- .../molecule/default/prepare.yml | 63 ++++------------ .../molecule/docker_rm/converge.yml | 33 --------- .../molecule/docker_rm/molecule.yml | 48 ------------ .../molecule/legacy_vars/molecule.yml | 2 + .../molecule/podman-rm-stopped/molecule.yml | 2 + .../molecule/podman/converge.yml | 26 ------- .../molecule/podman/molecule.yml | 43 ----------- .../molecule/podman/prepare.yml | 41 ----------- .../molecule/default/Dockerfile | 37 ---------- .../molecule/default/converge.yml | 6 +- .../molecule/default/molecule.yml | 2 + .../molecule/default/prepare.yml | 63 ++++------------ .../molecule/podman/Dockerfile | 37 ---------- .../molecule/podman/converge.yml | 27 ------- .../molecule/podman/molecule.yml | 48 ------------ .../molecule/podman/prepare.yml | 41 ----------- .../tripleo_container_tag/defaults/main.yml | 2 +- .../molecule/default/converge.yml | 7 +- .../molecule/default/molecule.yml | 7 +- .../molecule/default/prepare.yml | 55 ++------------ .../molecule/legacy_vars/molecule.yml | 2 + .../molecule/podman/converge.yml | 30 -------- .../molecule/podman/molecule.yml | 43 ----------- .../molecule/podman/prepare.yml | 32 -------- .../molecule/addkey/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../molecule/keygen/molecule.yml | 5 +- .../molecule/ansible_hieradata/molecule.yml | 2 +- .../molecule/default/molecule.yml | 5 +- .../molecule/hieradata_vars/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../molecule/default/molecule.yml | 22 ++---- .../molecule/legacy_vars/molecule.yml | 22 ++---- .../molecule/default/converge.yml | 1 + .../molecule/default/molecule.yml | 47 +++++++----- .../molecule/default/prepare.yml | 43 ++++++----- .../molecule/default/molecule.yml | 5 +- .../molecule/default/molecule.yml | 2 +- .../molecule/default/molecule.yml | 19 ++--- .../molecule/positive/molecule.yml | 23 ++---- .../molecule/default/molecule.yml | 14 ++-- .../molecule/external_upgrade/molecule.yml | 14 ++-- .../molecule/ffu/molecule.yml | 14 ++-- .../molecule/update/molecule.yml | 13 ++-- .../molecule/upgrade/molecule.yml | 12 +-- .../molecule/default/molecule.yml | 5 +- .../roles/tripleo_persist/tasks/cleanup.yml | 2 +- .../molecule/default/molecule.yml | 2 + .../molecule/default/prepare.yml | 35 +-------- .../molecule/install/molecule.yml | 2 + .../molecule/login/molecule.yml | 2 + .../tripleo_podman/molecule/login/prepare.yml | 26 ++++--- .../tripleo_ptp/molecule/default/molecule.yml | 22 ++---- .../molecule/ntp_stop/molecule.yml | 12 ++- .../molecule/default/molecule.yml | 5 +- .../molecule/create/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../molecule/no_networks/molecule.yml | 5 +- .../molecule/banners/molecule.yml | 22 ++---- .../molecule/default/molecule.yml | 22 ++---- .../molecule/default/molecule.yml | 11 ++- .../molecule/default/molecule.yml | 22 ++---- .../molecule/default/molecule.yml | 21 ++---- .../molecule/default/molecule.yml | 5 +- .../molecule/default/molecule.yml | 5 +- .../roles/tuned/molecule/default/Dockerfile | 36 --------- .../roles/tuned/molecule/default/converge.yml | 1 + .../roles/tuned/molecule/default/molecule.yml | 73 +++++++------------ .../roles/tuned/molecule/isolated/Dockerfile | 36 --------- .../tuned/molecule/isolated/converge.yml | 1 + .../tuned/molecule/isolated/molecule.yml | 73 +++++++------------ zuul.d/layout.yaml | 10 ++- zuul.d/playbooks/pre.yml | 63 +++++++++------- zuul.d/playbooks/run.yml | 1 + 108 files changed, 538 insertions(+), 1312 deletions(-) delete mode 100755 tools/test-setup.sh delete mode 100644 tripleo_ansible/roles/backup_and_restore/molecule/default/Dockerfile delete mode 100644 tripleo_ansible/roles/tripleo_bootstrap/molecule/default/Dockerfile delete mode 100644 tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/converge.yml delete mode 100644 tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/molecule.yml delete mode 100644 tripleo_ansible/roles/tripleo_container_rm/molecule/podman/converge.yml delete mode 100644 tripleo_ansible/roles/tripleo_container_rm/molecule/podman/molecule.yml delete mode 100644 tripleo_ansible/roles/tripleo_container_rm/molecule/podman/prepare.yml delete mode 100644 tripleo_ansible/roles/tripleo_container_stop/molecule/default/Dockerfile delete mode 100644 tripleo_ansible/roles/tripleo_container_stop/molecule/podman/Dockerfile delete mode 100644 tripleo_ansible/roles/tripleo_container_stop/molecule/podman/converge.yml delete mode 100644 tripleo_ansible/roles/tripleo_container_stop/molecule/podman/molecule.yml delete mode 100644 tripleo_ansible/roles/tripleo_container_stop/molecule/podman/prepare.yml delete mode 100644 tripleo_ansible/roles/tripleo_container_tag/molecule/podman/converge.yml delete mode 100644 tripleo_ansible/roles/tripleo_container_tag/molecule/podman/molecule.yml delete mode 100644 tripleo_ansible/roles/tripleo_container_tag/molecule/podman/prepare.yml delete mode 100644 tripleo_ansible/roles/tuned/molecule/default/Dockerfile delete mode 100644 tripleo_ansible/roles/tuned/molecule/isolated/Dockerfile diff --git a/_skeleton_role_/molecule/default/molecule.yml b/_skeleton_role_/molecule/default/molecule.yml index 78971ff18..8d3c2ab1e 100644 --- a/_skeleton_role_/molecule/default/molecule.yml +++ b/_skeleton_role_/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/bindep.txt b/bindep.txt index 8e60cc8f1..1704f8b2f 100644 --- a/bindep.txt +++ b/bindep.txt @@ -18,6 +18,7 @@ gcc-c++ [platform:rpm] git [platform:rpm] libffi-devel [platform:rpm] openssl-devel [platform:rpm] +podman [platform:rpm] python-devel [platform:rpm !platform:rhel-8 !platform:centos-8] python3-devel [platform:rpm !platform:rhel-7 !platform:centos-7] PyYAML [platform:rpm !platform:rhel-8 !platform:centos-8] diff --git a/molecule-requirements.txt b/molecule-requirements.txt index dfecfddb0..9c4bd872d 100644 --- a/molecule-requirements.txt +++ b/molecule-requirements.txt @@ -1,6 +1,5 @@ # this is required for the molecule jobs ansi2html -docker # https://github.com/sqlalchemy/dogpile.cache/issues/178 (openstacksdk) dogpile.cache>=0.6.5,<0.9.1 # MIT openstacksdk diff --git a/scripts/run-local-test b/scripts/run-local-test index 3e5ea959a..4c3fcf1a3 100755 --- a/scripts/run-local-test +++ b/scripts/run-local-test @@ -51,6 +51,10 @@ case "${ID,,}" in ;; esac +# Ensure the required ci file is presnet +sudo mkdir -p /etc/ci +sudo touch /etc/ci/mirror_info.sh + # Create a virtual env "${PYTHON_EXEC}" -m virtualenv --system-site-packages "${HOME}/test-python" diff --git a/tools/test-setup.sh b/tools/test-setup.sh deleted file mode 100755 index e3179bf91..000000000 --- a/tools/test-setup.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -euxo pipefail -# Used by Zuul CI to perform extra bootstrapping - -# Workaround for a potential: -# Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock -# See https://docs.docker.com/install/linux/linux-postinstall/ -newgrp docker || true diff --git a/tox.ini b/tox.ini index 1abd3a4cd..80d5a783b 100644 --- a/tox.ini +++ b/tox.ini @@ -104,7 +104,7 @@ deps = -r {toxinidir}/molecule-requirements.txt commands = bash -c "ansible-playbook -i localhost, role-addition.yml -e role_name=skeleton_test" - bash -c "if (podman ps 2> /dev/null || docker ps 2> /dev/null); then \ + bash -c "if podman ps 2> /dev/null; then \ cd {toxinidir}/tripleo_ansible/roles/skeleton_test; \ molecule test --all; \ else \ diff --git a/tripleo_ansible/roles/aide/molecule/default/molecule.yml b/tripleo_ansible/roles/aide/molecule/default/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/aide/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/aide/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/backup_and_restore/defaults/main.yml b/tripleo_ansible/roles/backup_and_restore/defaults/main.yml index 93b633795..33cbf451d 100644 --- a/tripleo_ansible/roles/backup_and_restore/defaults/main.yml +++ b/tripleo_ansible/roles/backup_and_restore/defaults/main.yml @@ -18,7 +18,7 @@ # All variables intended for modification should be placed in this file. # Set the container command line entry-point -tripleo_container_cli: "{{ container_cli | default('docker') }}" +tripleo_container_cli: "{{ container_cli | default('podman') }}" # Stop and start all running services before backup is ran. tripleo_backup_and_restore_service_manager: true diff --git a/tripleo_ansible/roles/backup_and_restore/molecule/default/Dockerfile b/tripleo_ansible/roles/backup_and_restore/molecule/default/Dockerfile deleted file mode 100644 index e0534b4d1..000000000 --- a/tripleo_ansible/roles/backup_and_restore/molecule/default/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# Molecule managed -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -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 {{ 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/tripleo_ansible/roles/backup_and_restore/molecule/default/converge.yml b/tripleo_ansible/roles/backup_and_restore/molecule/default/converge.yml index e70c54291..58a7a882b 100644 --- a/tripleo_ansible/roles/backup_and_restore/molecule/default/converge.yml +++ b/tripleo_ansible/roles/backup_and_restore/molecule/default/converge.yml @@ -24,5 +24,3 @@ tripleo_backup_and_restore_rear_simulate: true tripleo_backup_and_restore_service_manager: false tripleo_backup_and_restore_hiera_config_file: "{{ ansible_user_dir }}/hiera.yaml" - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" diff --git a/tripleo_ansible/roles/backup_and_restore/molecule/default/molecule.yml b/tripleo_ansible/roles/backup_and_restore/molecule/default/molecule.yml index 5caf74365..18c391c1d 100644 --- a/tripleo_ansible/roles/backup_and_restore/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/backup_and_restore/molecule/default/molecule.yml @@ -37,6 +37,8 @@ provisioner: env: ANSIBLE_STDOUT_CALLBACK: yaml ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: name: default diff --git a/tripleo_ansible/roles/backup_and_restore/molecule/default/prepare.yml b/tripleo_ansible/roles/backup_and_restore/molecule/default/prepare.yml index c850892cb..850524b4f 100644 --- a/tripleo_ansible/roles/backup_and_restore/molecule/default/prepare.yml +++ b/tripleo_ansible/roles/backup_and_restore/molecule/default/prepare.yml @@ -20,18 +20,6 @@ become: true gather_facts: true pre_tasks: - - name: Check for docker cli - command: "command -v docker" - register: docker_cli - failed_when: false - changed_when: false - - - name: Check for docker connection - command: "docker ps" - register: docker_ps - failed_when: false - changed_when: false - - name: set basic user fact set_fact: ansible_user: "{{ lookup('env', 'USER') }}" @@ -43,33 +31,22 @@ ansible_user_dir: "{{ lookup('env', 'HOME') }}" when: - ansible_user_dir is undefined + + - name: Disable SELinux + selinux: + state: disabled + roles: - role: test_deps - - role: ensure-docker - when: - - (docker_cli.rc != 0) or - (docker_ps.rc != 0) + test_deps_extra_packages: + - rear + - syslinux + - genisoimage + - kbd + - puppet + - hiera + post_tasks: - - name: Install docker-sdk - pip: - name: docker - virtualenv: "{{ ansible_user_dir }}/test-python" - virtualenv_site_packages: true - - - name: Install deps for ReaR - package: - name: "{{ rear_packages }}" - state: present - vars: - rear_packages: - - rear - - syslinux - - genisoimage - - kbd - - puppet - - hiera - - python3-docker - - name: Create hiera config file file: path: "{{ ansible_user_dir }}/hiera.yaml" @@ -102,31 +79,26 @@ } - name: pull some images - docker_image: + podman_image: name: "{{ item }}" - source: pull - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" with_items: - centos:8 - mysql - name: Create a data container - docker_container: + podman_container: name: "{{ item }}" image: centos:8 - detach: true + state: started command: sleep 1d with_items: - - docker-container1 - - docker-container2 - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" + - test-container1 + - test-container2 - name: Start myql container - docker_container: + podman_container: name: mysql image: mysql - detach: true + state: started env: MYSQL_ROOT_PASSWORD: password diff --git a/tripleo_ansible/roles/login_defs/molecule/default/molecule.yml b/tripleo_ansible/roles/login_defs/molecule/default/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/login_defs/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/login_defs/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/test_deps/molecule/default/molecule.yml b/tripleo_ansible/roles/test_deps/molecule/default/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/test_deps/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/test_deps/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/test_deps/tasks/tripleo-setup.yml b/tripleo_ansible/roles/test_deps/tasks/tripleo-setup.yml index 0fae514a2..a7672044f 100644 --- a/tripleo_ansible/roles/test_deps/tasks/tripleo-setup.yml +++ b/tripleo_ansible/roles/test_deps/tasks/tripleo-setup.yml @@ -33,6 +33,9 @@ name: "{{ test_deps_repo }}/{{ tripleo_package_fact }}" state: present + - name: Create tripleo repos + command: tripleo-repos -b master current-tripleo + - name: Install tripleo packages package: name: "{{ test_deps_tripleo_packages }}" diff --git a/tripleo_ansible/roles/test_package_action/molecule/default/molecule.yml b/tripleo_ansible/roles/test_package_action/molecule/default/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/test_package_action/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/test_package_action/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/test_package_action/molecule/negative/molecule.yml b/tripleo_ansible/roles/test_package_action/molecule/negative/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/test_package_action/molecule/negative/molecule.yml +++ b/tripleo_ansible/roles/test_package_action/molecule/negative/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/test_package_action/molecule/positive/molecule.yml b/tripleo_ansible/roles/test_package_action/molecule/positive/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/test_package_action/molecule/positive/molecule.yml +++ b/tripleo_ansible/roles/test_package_action/molecule/positive/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_bootstrap/molecule/default/Dockerfile b/tripleo_ansible/roles/tripleo_bootstrap/molecule/default/Dockerfile deleted file mode 100644 index e0534b4d1..000000000 --- a/tripleo_ansible/roles/tripleo_bootstrap/molecule/default/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# Molecule managed -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -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 {{ 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/tripleo_ansible/roles/tripleo_bootstrap/molecule/default/converge.yml b/tripleo_ansible/roles/tripleo_bootstrap/molecule/default/converge.yml index ddec34613..5aa039b50 100644 --- a/tripleo_ansible/roles/tripleo_bootstrap/molecule/default/converge.yml +++ b/tripleo_ansible/roles/tripleo_bootstrap/molecule/default/converge.yml @@ -16,6 +16,7 @@ - name: Converge + become: true hosts: all roles: - role: "tripleo_bootstrap" diff --git a/tripleo_ansible/roles/tripleo_bootstrap/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_bootstrap/molecule/default/molecule.yml index 6990f04f4..99e251515 100644 --- a/tripleo_ansible/roles/tripleo_bootstrap/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_bootstrap/molecule/default/molecule.yml @@ -1,66 +1,45 @@ --- driver: - name: docker + name: delegated + options: + managed: false + login_cmd_template: >- + ssh + -o UserKnownHostsFile=/dev/null + -o StrictHostKeyChecking=no + -o Compression=no + -o TCPKeepAlive=yes + -o VerifyHostKeyDNS=no + -o ForwardX11=no + -o ForwardAgent=no + {instance} + ansible_connection_options: + ansible_connection: ssh log: true platforms: - - name: centos7 - hostname: centos7 - image: centos:7 - dockerfile: Dockerfile - pkg_extras: python-setuptools - easy_install: - - pip - environment: &env - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" - command: /sbin/init - tmpfs: - - /run - - /tmp - capabilities: - - ALL # CENT7 requires all due to the age of the software - volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - - name: centos8 - hostname: centos8 - image: centos:8 - dockerfile: Dockerfile - pkg_extras: python*-setuptools NetworkManager - environment: - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" - command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp - capabilities: - - SYS_ADMIN - volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + - name: instance provisioner: name: ansible + inventory: + hosts: + all: + hosts: + instance: + ansible_host: localhost log: true env: ANSIBLE_STDOUT_CALLBACK: yaml + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: test_sequence: - - destroy - - create - prepare - converge - check - - verify - - destroy verifier: name: testinfra diff --git a/tripleo_ansible/roles/tripleo_bootstrap/tasks/main.yml b/tripleo_ansible/roles/tripleo_bootstrap/tasks/main.yml index eb125a1f4..fb6d9567c 100644 --- a/tripleo_ansible/roles/tripleo_bootstrap/tasks/main.yml +++ b/tripleo_ansible/roles/tripleo_bootstrap/tasks/main.yml @@ -72,9 +72,7 @@ shell: >- ln -f -s /usr/share/openstack-puppet/modules/* /etc/puppet/modules/ register: result - failed_when: - - result.rc != 0 - - "'cannot overwrite directory' not in result.stderr" + failed_when: false tags: - skip_ansible_lint diff --git a/tripleo_ansible/roles/tripleo_cellv2/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_cellv2/molecule/default/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/tripleo_cellv2/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_cellv2/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_ceph_common/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_ceph_common/molecule/default/molecule.yml index ce4ebde21..79c04658d 100644 --- a/tripleo_ansible/roles/tripleo_ceph_common/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_ceph_common/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_ceph_run_ansible/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_ceph_run_ansible/molecule/default/molecule.yml index ce4ebde21..79c04658d 100644 --- a/tripleo_ansible/roles/tripleo_ceph_run_ansible/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_ceph_run_ansible/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_ceph_uuid/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_ceph_uuid/molecule/default/molecule.yml index ce4ebde21..79c04658d 100644 --- a/tripleo_ansible/roles/tripleo_ceph_uuid/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_ceph_uuid/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_ceph_work_dir/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_ceph_work_dir/molecule/default/molecule.yml index ce4ebde21..79c04658d 100644 --- a/tripleo_ansible/roles/tripleo_ceph_work_dir/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_ceph_work_dir/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_clients_install/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_clients_install/molecule/default/molecule.yml index 78971ff18..8d3c2ab1e 100644 --- a/tripleo_ansible/roles/tripleo_clients_install/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_clients_install/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_config/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_config/molecule/default/molecule.yml index 78971ff18..8d3c2ab1e 100644 --- a/tripleo_ansible/roles/tripleo_config/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_config/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_container_image_prepare/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_container_image_prepare/molecule/default/molecule.yml index 78971ff18..8d3c2ab1e 100644 --- a/tripleo_ansible/roles/tripleo_container_image_prepare/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_container_image_prepare/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_container_rm/defaults/main.yml b/tripleo_ansible/roles/tripleo_container_rm/defaults/main.yml index 7edaf4aec..04b5a144c 100644 --- a/tripleo_ansible/roles/tripleo_container_rm/defaults/main.yml +++ b/tripleo_ansible/roles/tripleo_container_rm/defaults/main.yml @@ -26,7 +26,7 @@ # is no longer in use. # # Set the container command line entry-point -tripleo_container_cli: "{{ container_cli | default('docker') }}" +tripleo_container_cli: "{{ container_cli | default('podman') }}" # List of containers to delete tripleo_containers_to_rm: "{{ containers_to_rm | default([]) }}" diff --git a/tripleo_ansible/roles/tripleo_container_rm/molecule/default/converge.yml b/tripleo_ansible/roles/tripleo_container_rm/molecule/default/converge.yml index 790034e76..2d0ecd166 100644 --- a/tripleo_ansible/roles/tripleo_container_rm/molecule/default/converge.yml +++ b/tripleo_ansible/roles/tripleo_container_rm/molecule/default/converge.yml @@ -20,10 +20,7 @@ hosts: all roles: - role: tripleo_container_rm + tripleo_container_cli: podman tripleo_containers_to_rm: - - docker-container1 - - docker-container2 - tripleo_container_cli: docker - - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" + - podman-container1 + - podman-container2 diff --git a/tripleo_ansible/roles/tripleo_container_rm/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_container_rm/molecule/default/molecule.yml index 7eb62e0cb..99e251515 100644 --- a/tripleo_ansible/roles/tripleo_container_rm/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_container_rm/molecule/default/molecule.yml @@ -23,10 +23,6 @@ platforms: provisioner: name: ansible - config_options: - defaults: - fact_caching: jsonfile - fact_caching_connection: /tmp/molecule/facts inventory: hosts: all: @@ -36,10 +32,10 @@ provisioner: log: true env: ANSIBLE_STDOUT_CALLBACK: yaml - ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: - name: default test_sequence: - prepare - converge diff --git a/tripleo_ansible/roles/tripleo_container_rm/molecule/default/prepare.yml b/tripleo_ansible/roles/tripleo_container_rm/molecule/default/prepare.yml index 36d54aa0a..bd8c5949c 100644 --- a/tripleo_ansible/roles/tripleo_container_rm/molecule/default/prepare.yml +++ b/tripleo_ansible/roles/tripleo_container_rm/molecule/default/prepare.yml @@ -19,58 +19,23 @@ hosts: all become: true gather_facts: true - pre_tasks: - - name: Check for docker cli - command: "command -v docker" - register: docker_cli - failed_when: false - changed_when: false - - - name: Check for docker connection - command: "docker ps" - register: docker_ps - failed_when: false - changed_when: false - - - name: set basic user fact - set_fact: - ansible_user: "{{ lookup('env', 'USER') }}" - when: - - ansible_user is undefined - - - name: set basic home fact - set_fact: - ansible_user_dir: "{{ lookup('env', 'HOME') }}" - when: - - ansible_user_dir is undefined + vars: + required_packages: + - podman roles: - role: test_deps - - role: ensure-docker - when: - - (docker_cli.rc != 0) or - (docker_ps.rc != 0) post_tasks: - - name: Install docker-sdk - pip: - name: docker - virtualenv: "{{ ansible_user_dir }}/test-python" - virtualenv_site_packages: true + - name: Install podman + become: true + package: + name: "{{ required_packages }}" + state: latest - - name: pull an image - docker_image: - name: centos:8 - source: pull - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" + - name: Pull container image + command: "podman pull centos:8" - - name: Create a data container - docker_container: - name: "{{ item }}" - image: centos:8 - detach: true - command: sleep 1d + - name: Create test containers + command: "podman run -itd --systemd true --name {{ item }} fedora bash" with_items: - - docker-container1 - - docker-container2 - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" + - podman-container1 + - podman-container2 diff --git a/tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/converge.yml b/tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/converge.yml deleted file mode 100644 index cfe514cd4..000000000 --- a/tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/converge.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -# NOTE(Cloudnull): This role is a linked role to `tripleo_container_rm`. This role and exists -# to ensure we're providing a stable interface as we transition. In a future -# release this link will be removed in favor of using the stable role, -# `tripleo_container_rm`. -- name: Converge - become: true - hosts: all - roles: - - role: tripleo_container_rm - container_cli: docker - containers_to_rm: - - docker-container1 - - docker-container2 - - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" diff --git a/tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/molecule.yml b/tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/molecule.yml deleted file mode 100644 index faf389d6a..000000000 --- a/tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/molecule.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -driver: - name: delegated - options: - managed: false - login_cmd_template: >- - ssh - -o UserKnownHostsFile=/dev/null - -o StrictHostKeyChecking=no - -o Compression=no - -o TCPKeepAlive=yes - -o VerifyHostKeyDNS=no - -o ForwardX11=no - -o ForwardAgent=no - {instance} - ansible_connection_options: - ansible_connection: ssh - -log: true - -platforms: - - name: instance - -provisioner: - name: ansible - config_options: - defaults: - fact_caching: jsonfile - fact_caching_connection: /tmp/molecule/facts - inventory: - hosts: - all: - hosts: - instance: - ansible_host: localhost - log: true - env: - ANSIBLE_STDOUT_CALLBACK: yaml - ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" - -scenario: - test_sequence: - - prepare - - converge - - check - -verifier: - name: testinfra diff --git a/tripleo_ansible/roles/tripleo_container_rm/molecule/legacy_vars/molecule.yml b/tripleo_ansible/roles/tripleo_container_rm/molecule/legacy_vars/molecule.yml index e81ce0b9d..99e251515 100644 --- a/tripleo_ansible/roles/tripleo_container_rm/molecule/legacy_vars/molecule.yml +++ b/tripleo_ansible/roles/tripleo_container_rm/molecule/legacy_vars/molecule.yml @@ -32,6 +32,8 @@ provisioner: log: true env: ANSIBLE_STDOUT_CALLBACK: yaml + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: test_sequence: diff --git a/tripleo_ansible/roles/tripleo_container_rm/molecule/podman-rm-stopped/molecule.yml b/tripleo_ansible/roles/tripleo_container_rm/molecule/podman-rm-stopped/molecule.yml index e81ce0b9d..99e251515 100644 --- a/tripleo_ansible/roles/tripleo_container_rm/molecule/podman-rm-stopped/molecule.yml +++ b/tripleo_ansible/roles/tripleo_container_rm/molecule/podman-rm-stopped/molecule.yml @@ -32,6 +32,8 @@ provisioner: log: true env: ANSIBLE_STDOUT_CALLBACK: yaml + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: test_sequence: diff --git a/tripleo_ansible/roles/tripleo_container_rm/molecule/podman/converge.yml b/tripleo_ansible/roles/tripleo_container_rm/molecule/podman/converge.yml deleted file mode 100644 index 2d0ecd166..000000000 --- a/tripleo_ansible/roles/tripleo_container_rm/molecule/podman/converge.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- name: Converge - become: true - hosts: all - roles: - - role: tripleo_container_rm - tripleo_container_cli: podman - tripleo_containers_to_rm: - - podman-container1 - - podman-container2 diff --git a/tripleo_ansible/roles/tripleo_container_rm/molecule/podman/molecule.yml b/tripleo_ansible/roles/tripleo_container_rm/molecule/podman/molecule.yml deleted file mode 100644 index e81ce0b9d..000000000 --- a/tripleo_ansible/roles/tripleo_container_rm/molecule/podman/molecule.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -driver: - name: delegated - options: - managed: false - login_cmd_template: >- - ssh - -o UserKnownHostsFile=/dev/null - -o StrictHostKeyChecking=no - -o Compression=no - -o TCPKeepAlive=yes - -o VerifyHostKeyDNS=no - -o ForwardX11=no - -o ForwardAgent=no - {instance} - ansible_connection_options: - ansible_connection: ssh - -log: true - -platforms: - - name: instance - -provisioner: - name: ansible - inventory: - hosts: - all: - hosts: - instance: - ansible_host: localhost - log: true - env: - ANSIBLE_STDOUT_CALLBACK: yaml - -scenario: - test_sequence: - - prepare - - converge - - check - -verifier: - name: testinfra diff --git a/tripleo_ansible/roles/tripleo_container_rm/molecule/podman/prepare.yml b/tripleo_ansible/roles/tripleo_container_rm/molecule/podman/prepare.yml deleted file mode 100644 index bd8c5949c..000000000 --- a/tripleo_ansible/roles/tripleo_container_rm/molecule/podman/prepare.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- name: Prepare - hosts: all - become: true - gather_facts: true - vars: - required_packages: - - podman - roles: - - role: test_deps - post_tasks: - - name: Install podman - become: true - package: - name: "{{ required_packages }}" - state: latest - - - name: Pull container image - command: "podman pull centos:8" - - - name: Create test containers - command: "podman run -itd --systemd true --name {{ item }} fedora bash" - with_items: - - podman-container1 - - podman-container2 diff --git a/tripleo_ansible/roles/tripleo_container_stop/molecule/default/Dockerfile b/tripleo_ansible/roles/tripleo_container_stop/molecule/default/Dockerfile deleted file mode 100644 index e0534b4d1..000000000 --- a/tripleo_ansible/roles/tripleo_container_stop/molecule/default/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# Molecule managed -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -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 {{ 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/tripleo_ansible/roles/tripleo_container_stop/molecule/default/converge.yml b/tripleo_ansible/roles/tripleo_container_stop/molecule/default/converge.yml index 4a479245a..8a017f6ab 100644 --- a/tripleo_ansible/roles/tripleo_container_stop/molecule/default/converge.yml +++ b/tripleo_ansible/roles/tripleo_container_stop/molecule/default/converge.yml @@ -21,7 +21,5 @@ roles: - role: tripleo_container_stop tripleo_containers_to_stop: - - docker-container1 - - docker-container2 - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" + - podman-container1 + - podman-container2 diff --git a/tripleo_ansible/roles/tripleo_container_stop/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_container_stop/molecule/default/molecule.yml index faf389d6a..0aaf9bd42 100644 --- a/tripleo_ansible/roles/tripleo_container_stop/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_container_stop/molecule/default/molecule.yml @@ -37,6 +37,8 @@ provisioner: env: ANSIBLE_STDOUT_CALLBACK: yaml ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: test_sequence: diff --git a/tripleo_ansible/roles/tripleo_container_stop/molecule/default/prepare.yml b/tripleo_ansible/roles/tripleo_container_stop/molecule/default/prepare.yml index 36d54aa0a..bd8c5949c 100644 --- a/tripleo_ansible/roles/tripleo_container_stop/molecule/default/prepare.yml +++ b/tripleo_ansible/roles/tripleo_container_stop/molecule/default/prepare.yml @@ -19,58 +19,23 @@ hosts: all become: true gather_facts: true - pre_tasks: - - name: Check for docker cli - command: "command -v docker" - register: docker_cli - failed_when: false - changed_when: false - - - name: Check for docker connection - command: "docker ps" - register: docker_ps - failed_when: false - changed_when: false - - - name: set basic user fact - set_fact: - ansible_user: "{{ lookup('env', 'USER') }}" - when: - - ansible_user is undefined - - - name: set basic home fact - set_fact: - ansible_user_dir: "{{ lookup('env', 'HOME') }}" - when: - - ansible_user_dir is undefined + vars: + required_packages: + - podman roles: - role: test_deps - - role: ensure-docker - when: - - (docker_cli.rc != 0) or - (docker_ps.rc != 0) post_tasks: - - name: Install docker-sdk - pip: - name: docker - virtualenv: "{{ ansible_user_dir }}/test-python" - virtualenv_site_packages: true + - name: Install podman + become: true + package: + name: "{{ required_packages }}" + state: latest - - name: pull an image - docker_image: - name: centos:8 - source: pull - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" + - name: Pull container image + command: "podman pull centos:8" - - name: Create a data container - docker_container: - name: "{{ item }}" - image: centos:8 - detach: true - command: sleep 1d + - name: Create test containers + command: "podman run -itd --systemd true --name {{ item }} fedora bash" with_items: - - docker-container1 - - docker-container2 - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" + - podman-container1 + - podman-container2 diff --git a/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/Dockerfile b/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/Dockerfile deleted file mode 100644 index e0534b4d1..000000000 --- a/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# Molecule managed -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -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 {{ 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/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/converge.yml b/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/converge.yml deleted file mode 100644 index c091f6f8d..000000000 --- a/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/converge.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- name: Converge - become: true - hosts: all - roles: - - role: tripleo_container_stop - tripleo_containers_to_stop: - - podman-container1 - - podman-container2 - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" diff --git a/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/molecule.yml b/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/molecule.yml deleted file mode 100644 index faf389d6a..000000000 --- a/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/molecule.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -driver: - name: delegated - options: - managed: false - login_cmd_template: >- - ssh - -o UserKnownHostsFile=/dev/null - -o StrictHostKeyChecking=no - -o Compression=no - -o TCPKeepAlive=yes - -o VerifyHostKeyDNS=no - -o ForwardX11=no - -o ForwardAgent=no - {instance} - ansible_connection_options: - ansible_connection: ssh - -log: true - -platforms: - - name: instance - -provisioner: - name: ansible - config_options: - defaults: - fact_caching: jsonfile - fact_caching_connection: /tmp/molecule/facts - inventory: - hosts: - all: - hosts: - instance: - ansible_host: localhost - log: true - env: - ANSIBLE_STDOUT_CALLBACK: yaml - ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" - -scenario: - test_sequence: - - prepare - - converge - - check - -verifier: - name: testinfra diff --git a/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/prepare.yml b/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/prepare.yml deleted file mode 100644 index bd8c5949c..000000000 --- a/tripleo_ansible/roles/tripleo_container_stop/molecule/podman/prepare.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- name: Prepare - hosts: all - become: true - gather_facts: true - vars: - required_packages: - - podman - roles: - - role: test_deps - post_tasks: - - name: Install podman - become: true - package: - name: "{{ required_packages }}" - state: latest - - - name: Pull container image - command: "podman pull centos:8" - - - name: Create test containers - command: "podman run -itd --systemd true --name {{ item }} fedora bash" - with_items: - - podman-container1 - - podman-container2 diff --git a/tripleo_ansible/roles/tripleo_container_tag/defaults/main.yml b/tripleo_ansible/roles/tripleo_container_tag/defaults/main.yml index 0c4e67e01..2ab6e529a 100644 --- a/tripleo_ansible/roles/tripleo_container_tag/defaults/main.yml +++ b/tripleo_ansible/roles/tripleo_container_tag/defaults/main.yml @@ -28,7 +28,7 @@ # is no longer in use. # # Set the container command line entry-point -tripleo_container_cli: "{{ container_cli | default('docker') }}" +tripleo_container_cli: "{{ container_cli | default('podman') }}" # Enable or disable pulling images. tripleo_container_pull_image: "{{ pull_image | default(true) }}" diff --git a/tripleo_ansible/roles/tripleo_container_tag/molecule/default/converge.yml b/tripleo_ansible/roles/tripleo_container_tag/molecule/default/converge.yml index 84941b6bc..05fc6ee16 100644 --- a/tripleo_ansible/roles/tripleo_container_tag/molecule/default/converge.yml +++ b/tripleo_ansible/roles/tripleo_container_tag/molecule/default/converge.yml @@ -16,16 +16,15 @@ - name: Converge - become: true hosts: all + become: true roles: - role: "tripleo_container_tag" tripleo_container_image: centos:8 tripleo_container_image_latest: test-latest - tripleo_container_cli: docker - tripleo_container_pull_image: true + tripleo_container_cli: podman - role: "tripleo_container_tag" tripleo_container_image: centos:8 tripleo_container_image_latest: test-latest-2 - tripleo_container_cli: docker + tripleo_container_cli: podman tripleo_container_pull_image: false diff --git a/tripleo_ansible/roles/tripleo_container_tag/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_container_tag/molecule/default/molecule.yml index faf389d6a..99e251515 100644 --- a/tripleo_ansible/roles/tripleo_container_tag/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_container_tag/molecule/default/molecule.yml @@ -23,10 +23,6 @@ platforms: provisioner: name: ansible - config_options: - defaults: - fact_caching: jsonfile - fact_caching_connection: /tmp/molecule/facts inventory: hosts: all: @@ -36,7 +32,8 @@ provisioner: log: true env: ANSIBLE_STDOUT_CALLBACK: yaml - ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: test_sequence: diff --git a/tripleo_ansible/roles/tripleo_container_tag/molecule/default/prepare.yml b/tripleo_ansible/roles/tripleo_container_tag/molecule/default/prepare.yml index 4c747f016..b3d30fb0e 100644 --- a/tripleo_ansible/roles/tripleo_container_tag/molecule/default/prepare.yml +++ b/tripleo_ansible/roles/tripleo_container_tag/molecule/default/prepare.yml @@ -19,53 +19,14 @@ hosts: all become: true gather_facts: true - pre_tasks: - - name: Check for docker cli - command: "command -v docker" - register: docker_cli - failed_when: false - changed_when: false - - - name: Check for docker connection - command: "docker ps" - register: docker_ps - failed_when: false - changed_when: false - - - name: set basic user fact - set_fact: - ansible_user: "{{ lookup('env', 'USER') }}" - when: - - ansible_user is undefined - - - name: set basic home fact - set_fact: - ansible_user_dir: "{{ lookup('env', 'HOME') }}" - when: - - ansible_user_dir is undefined + vars: + required_packages: + - podman roles: - role: test_deps - - role: ensure-docker - when: - - (docker_cli.rc != 0) or - (docker_ps.rc != 0) post_tasks: - - name: Install docker-sdk - pip: - name: docker - virtualenv: "{{ ansible_user_dir }}/test-python" - virtualenv_site_packages: true - - - name: pull an image - docker_image: - name: centos:8 - source: pull - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" - - - name: Create a data container - docker_container: - name: test-container - image: centos:8 - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" + - name: Install podman + become: true + package: + name: "{{ required_packages }}" + state: latest diff --git a/tripleo_ansible/roles/tripleo_container_tag/molecule/legacy_vars/molecule.yml b/tripleo_ansible/roles/tripleo_container_tag/molecule/legacy_vars/molecule.yml index e81ce0b9d..99e251515 100644 --- a/tripleo_ansible/roles/tripleo_container_tag/molecule/legacy_vars/molecule.yml +++ b/tripleo_ansible/roles/tripleo_container_tag/molecule/legacy_vars/molecule.yml @@ -32,6 +32,8 @@ provisioner: log: true env: ANSIBLE_STDOUT_CALLBACK: yaml + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: test_sequence: diff --git a/tripleo_ansible/roles/tripleo_container_tag/molecule/podman/converge.yml b/tripleo_ansible/roles/tripleo_container_tag/molecule/podman/converge.yml deleted file mode 100644 index 05fc6ee16..000000000 --- a/tripleo_ansible/roles/tripleo_container_tag/molecule/podman/converge.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- name: Converge - hosts: all - become: true - roles: - - role: "tripleo_container_tag" - tripleo_container_image: centos:8 - tripleo_container_image_latest: test-latest - tripleo_container_cli: podman - - role: "tripleo_container_tag" - tripleo_container_image: centos:8 - tripleo_container_image_latest: test-latest-2 - tripleo_container_cli: podman - tripleo_container_pull_image: false diff --git a/tripleo_ansible/roles/tripleo_container_tag/molecule/podman/molecule.yml b/tripleo_ansible/roles/tripleo_container_tag/molecule/podman/molecule.yml deleted file mode 100644 index e81ce0b9d..000000000 --- a/tripleo_ansible/roles/tripleo_container_tag/molecule/podman/molecule.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -driver: - name: delegated - options: - managed: false - login_cmd_template: >- - ssh - -o UserKnownHostsFile=/dev/null - -o StrictHostKeyChecking=no - -o Compression=no - -o TCPKeepAlive=yes - -o VerifyHostKeyDNS=no - -o ForwardX11=no - -o ForwardAgent=no - {instance} - ansible_connection_options: - ansible_connection: ssh - -log: true - -platforms: - - name: instance - -provisioner: - name: ansible - inventory: - hosts: - all: - hosts: - instance: - ansible_host: localhost - log: true - env: - ANSIBLE_STDOUT_CALLBACK: yaml - -scenario: - test_sequence: - - prepare - - converge - - check - -verifier: - name: testinfra diff --git a/tripleo_ansible/roles/tripleo_container_tag/molecule/podman/prepare.yml b/tripleo_ansible/roles/tripleo_container_tag/molecule/podman/prepare.yml deleted file mode 100644 index b3d30fb0e..000000000 --- a/tripleo_ansible/roles/tripleo_container_tag/molecule/podman/prepare.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -- name: Prepare - hosts: all - become: true - gather_facts: true - vars: - required_packages: - - podman - roles: - - role: test_deps - post_tasks: - - name: Install podman - become: true - package: - name: "{{ required_packages }}" - state: latest diff --git a/tripleo_ansible/roles/tripleo_create_admin/molecule/addkey/molecule.yml b/tripleo_ansible/roles/tripleo_create_admin/molecule/addkey/molecule.yml index 78971ff18..8d3c2ab1e 100644 --- a/tripleo_ansible/roles/tripleo_create_admin/molecule/addkey/molecule.yml +++ b/tripleo_ansible/roles/tripleo_create_admin/molecule/addkey/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_create_admin/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_create_admin/molecule/default/molecule.yml index 78971ff18..8d3c2ab1e 100644 --- a/tripleo_ansible/roles/tripleo_create_admin/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_create_admin/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_create_admin/molecule/keygen/molecule.yml b/tripleo_ansible/roles/tripleo_create_admin/molecule/keygen/molecule.yml index 78971ff18..8d3c2ab1e 100644 --- a/tripleo_ansible/roles/tripleo_create_admin/molecule/keygen/molecule.yml +++ b/tripleo_ansible/roles/tripleo_create_admin/molecule/keygen/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_hieradata/molecule/ansible_hieradata/molecule.yml b/tripleo_ansible/roles/tripleo_hieradata/molecule/ansible_hieradata/molecule.yml index dd670ed26..7c9bf25f7 100644 --- a/tripleo_ansible/roles/tripleo_hieradata/molecule/ansible_hieradata/molecule.yml +++ b/tripleo_ansible/roles/tripleo_hieradata/molecule/ansible_hieradata/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true diff --git a/tripleo_ansible/roles/tripleo_hieradata/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_hieradata/molecule/default/molecule.yml index 78971ff18..8d3c2ab1e 100644 --- a/tripleo_ansible/roles/tripleo_hieradata/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_hieradata/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_hieradata/molecule/hieradata_vars/molecule.yml b/tripleo_ansible/roles/tripleo_hieradata/molecule/hieradata_vars/molecule.yml index dd670ed26..76167e0df 100644 --- a/tripleo_ansible/roles/tripleo_hieradata/molecule/hieradata_vars/molecule.yml +++ b/tripleo_ansible/roles/tripleo_hieradata/molecule/hieradata_vars/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_hosts_entries/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_hosts_entries/molecule/default/molecule.yml index bb25465ca..d21953e33 100644 --- a/tripleo_ansible/roles/tripleo_hosts_entries/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_hosts_entries/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_image_serve/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_image_serve/molecule/default/molecule.yml index 60c0b1e47..e5726bbbf 100644 --- a/tripleo_ansible/roles/tripleo_image_serve/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_image_serve/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,13 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - - ALL # CENT7 requires all due to the age of the software + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -35,16 +33,12 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - - SYS_ADMIN + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_image_serve/molecule/legacy_vars/molecule.yml b/tripleo_ansible/roles/tripleo_image_serve/molecule/legacy_vars/molecule.yml index 60c0b1e47..e5726bbbf 100644 --- a/tripleo_ansible/roles/tripleo_image_serve/molecule/legacy_vars/molecule.yml +++ b/tripleo_ansible/roles/tripleo_image_serve/molecule/legacy_vars/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,13 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - - ALL # CENT7 requires all due to the age of the software + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -35,16 +33,12 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - - SYS_ADMIN + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/converge.yml b/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/converge.yml index 392046d1a..8d74eadb6 100644 --- a/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/converge.yml +++ b/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/converge.yml @@ -17,6 +17,7 @@ - name: Converge hosts: all + become: true tasks: - name: Create openstack directory file: diff --git a/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/molecule.yml index e37e9f371..7f254952a 100644 --- a/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/molecule.yml @@ -1,38 +1,51 @@ --- driver: - name: docker + name: delegated + options: + managed: false + login_cmd_template: >- + ssh + -o UserKnownHostsFile=/dev/null + -o StrictHostKeyChecking=no + -o Compression=no + -o TCPKeepAlive=yes + -o VerifyHostKeyDNS=no + -o ForwardX11=no + -o ForwardAgent=no + {instance} + ansible_connection_options: + ansible_connection: ssh log: true platforms: - - name: centos7 - hostname: centos7 - image: centos:7 - dockerfile: Dockerfile - network_mode: host - volumes: - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - easy_install: - - pip - environment: &env - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" + - name: instance provisioner: name: ansible + config_options: + defaults: + fact_caching: jsonfile + fact_caching_connection: /tmp/molecule/facts + inventory: + hosts: + all: + hosts: + instance: + ansible_host: localhost log: true env: ANSIBLE_STDOUT_CALLBACK: yaml + ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: + name: default test_sequence: - - destroy - - create - prepare - converge - check - - verify - - destroy verifier: name: testinfra diff --git a/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/prepare.yml b/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/prepare.yml index eaff9a4f1..4a7925a41 100644 --- a/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/prepare.yml +++ b/tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/prepare.yml @@ -14,30 +14,33 @@ # License for the specific language governing permissions and limitations # under the License. -- hosts: localhost - connection: local - tasks: - - - name: Build keystone container - shell: docker build -t keystone-img -f Dockerfile.keystone . - - - name: Run keystone container - shell: docker run -d -p 5000:5000 --name keystone-docker keystone-img - - name: Prepare - hosts: all - tasks: + hosts: localhost + become: true + connection: local + pre_tasks: + - name: Disable SELinux + selinux: + state: disabled + tasks: - include_role: name: test_deps vars: test_deps_setup_tripleo: true - - - name: Instal pre packages - package: - name: - - python-setuptools - - python-openstacksdk - - python-openstackclient - - python-keystoneclient + test_deps_extra_packages: + - python3-openstacksdk + - python3-openstackclient + - python3-keystoneclient - ansible + + - name: Build keystone container + shell: "podman build -t keystone-img -f {{ playbook_dir }}/Dockerfile.keystone ." + become: false + + - name: Run keystone container + shell: |- + podman rm --force keystone-podman || true + podman run -d -p 5000:5000 --name keystone-podman keystone-img + sleep 30 + become: false diff --git a/tripleo_ansible/roles/tripleo_nova_image_cache/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_nova_image_cache/molecule/default/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/tripleo_nova_image_cache/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_nova_image_cache/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_nvdimm/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_nvdimm/molecule/default/molecule.yml index f27c41d88..d4a2ab437 100644 --- a/tripleo_ansible/roles/tripleo_nvdimm/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_nvdimm/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true diff --git a/tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/default/molecule.yml index a83e59913..9db1a9ef8 100644 --- a/tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,17 +16,16 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - - ALL # CENT7 requires all due to the age of the software + - ALL volumes: - /run/udev:/run/udev:ro - /sys/fs/cgroup:/sys/fs/cgroup:ro - /lib/modules:/lib/modules - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -37,17 +36,15 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - - SYS_ADMIN + - ALL volumes: - /run/udev:/run/udev:ro - /sys/fs/cgroup:/sys/fs/cgroup:ro - /lib/modules:/lib/modules - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/positive/molecule.yml b/tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/positive/molecule.yml index a5320eed3..e563a032f 100644 --- a/tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/positive/molecule.yml +++ b/tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/positive/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,16 +16,13 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - - ALL # CENT7 requires all due to the age of the software + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -36,16 +33,12 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - - SYS_ADMIN + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_packages/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_packages/molecule/default/molecule.yml index 87f536f3d..7b62ded8a 100644 --- a/tripleo_ansible/roles/tripleo_packages/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_packages/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,15 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - ALL volumes: - /dev:/dev - /lib/modules:/lib/modules - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -35,16 +35,14 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - ALL volumes: - /dev:/dev - /lib/modules:/lib/modules - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_packages/molecule/external_upgrade/molecule.yml b/tripleo_ansible/roles/tripleo_packages/molecule/external_upgrade/molecule.yml index 87f536f3d..7b62ded8a 100644 --- a/tripleo_ansible/roles/tripleo_packages/molecule/external_upgrade/molecule.yml +++ b/tripleo_ansible/roles/tripleo_packages/molecule/external_upgrade/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,15 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - ALL volumes: - /dev:/dev - /lib/modules:/lib/modules - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -35,16 +35,14 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - ALL volumes: - /dev:/dev - /lib/modules:/lib/modules - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_packages/molecule/ffu/molecule.yml b/tripleo_ansible/roles/tripleo_packages/molecule/ffu/molecule.yml index 70e4d310a..0051e52c8 100644 --- a/tripleo_ansible/roles/tripleo_packages/molecule/ffu/molecule.yml +++ b/tripleo_ansible/roles/tripleo_packages/molecule/ffu/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,15 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - ALL volumes: - /dev:/dev - /lib/modules:/lib/modules - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -35,16 +35,14 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - ALL volumes: - /dev:/dev - /lib/modules:/lib/modules - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_packages/molecule/update/molecule.yml b/tripleo_ansible/roles/tripleo_packages/molecule/update/molecule.yml index c43a8ab05..0afe8e3e7 100644 --- a/tripleo_ansible/roles/tripleo_packages/molecule/update/molecule.yml +++ b/tripleo_ansible/roles/tripleo_packages/molecule/update/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -20,15 +20,16 @@ platforms: /bin/mkdir -p /var/run/dbus && /usr/bin/dbus-uuidgen > /var/lib/dbus/machine-id && /usr/bin/dbus-daemon --config-file=/usr/share/dbus-1/system.conf - tmpfs: - - /run - - /tmp + capabilities: - ALL volumes: - /dev:/dev - /lib/modules:/lib/modules - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host # TODO(cloudnull): when RDO has centos8 repos this test node should be re-enabled. # @@ -45,7 +46,7 @@ platforms: # /bin/mkdir -p /var/run/dbus && # /usr/bin/dbus-uuidgen > /var/lib/dbus/machine-id && # /usr/bin/dbus-daemon --config-file=/usr/share/dbus-1/system.conf -# privileged: true +# # tmpfs: # - /run # - /tmp @@ -54,6 +55,8 @@ platforms: # volumes: # - /dev:/dev # - /lib/modules:/lib/modules +# privileged: true +# ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_packages/molecule/upgrade/molecule.yml b/tripleo_ansible/roles/tripleo_packages/molecule/upgrade/molecule.yml index c2efce7ba..69197d60b 100644 --- a/tripleo_ansible/roles/tripleo_packages/molecule/upgrade/molecule.yml +++ b/tripleo_ansible/roles/tripleo_packages/molecule/upgrade/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,15 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - ALL volumes: - /dev:/dev - /lib/modules:/lib/modules - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host # TODO(cloudnull): when RDO has centos8 repos this test node should be re-enabled. # @@ -37,7 +37,7 @@ platforms: # http_proxy: "{{ lookup('env', 'http_proxy') }}" # https_proxy: "{{ lookup('env', 'https_proxy') }}" # command: /sbin/init -# privileged: true +# # tmpfs: # - /run # - /tmp @@ -46,6 +46,8 @@ platforms: # volumes: # - /dev:/dev # - /lib/modules:/lib/modules +# privileged: true +# ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_persist/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_persist/molecule/default/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/tripleo_persist/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_persist/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_persist/tasks/cleanup.yml b/tripleo_ansible/roles/tripleo_persist/tasks/cleanup.yml index 41b81d2cb..e7df0120f 100644 --- a/tripleo_ansible/roles/tripleo_persist/tasks/cleanup.yml +++ b/tripleo_ansible/roles/tripleo_persist/tasks/cleanup.yml @@ -19,4 +19,4 @@ path: "{{ tripleo_persist_storage_root_dir }}" state: absent delegate_to: localhost - become: "{{ tripleo_persist_storage_root_become | bool }}" + become: true diff --git a/tripleo_ansible/roles/tripleo_podman/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_podman/molecule/default/molecule.yml index faf389d6a..0aaf9bd42 100644 --- a/tripleo_ansible/roles/tripleo_podman/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_podman/molecule/default/molecule.yml @@ -37,6 +37,8 @@ provisioner: env: ANSIBLE_STDOUT_CALLBACK: yaml ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: test_sequence: diff --git a/tripleo_ansible/roles/tripleo_podman/molecule/default/prepare.yml b/tripleo_ansible/roles/tripleo_podman/molecule/default/prepare.yml index 36d54aa0a..5a34ddb32 100644 --- a/tripleo_ansible/roles/tripleo_podman/molecule/default/prepare.yml +++ b/tripleo_ansible/roles/tripleo_podman/molecule/default/prepare.yml @@ -20,18 +20,6 @@ become: true gather_facts: true pre_tasks: - - name: Check for docker cli - command: "command -v docker" - register: docker_cli - failed_when: false - changed_when: false - - - name: Check for docker connection - command: "docker ps" - register: docker_ps - failed_when: false - changed_when: false - - name: set basic user fact set_fact: ansible_user: "{{ lookup('env', 'USER') }}" @@ -45,32 +33,17 @@ - ansible_user_dir is undefined roles: - role: test_deps - - role: ensure-docker - when: - - (docker_cli.rc != 0) or - (docker_ps.rc != 0) post_tasks: - - name: Install docker-sdk - pip: - name: docker - virtualenv: "{{ ansible_user_dir }}/test-python" - virtualenv_site_packages: true - - name: pull an image - docker_image: + podman_image: name: centos:8 - source: pull - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" - name: Create a data container - docker_container: + podman_container: name: "{{ item }}" image: centos:8 detach: true command: sleep 1d with_items: - - docker-container1 - - docker-container2 - vars: - ansible_python_interpreter: "{{ ansible_user_dir }}/test-python/bin/python" + - test-container1 + - test-container2 diff --git a/tripleo_ansible/roles/tripleo_podman/molecule/install/molecule.yml b/tripleo_ansible/roles/tripleo_podman/molecule/install/molecule.yml index faf389d6a..0aaf9bd42 100644 --- a/tripleo_ansible/roles/tripleo_podman/molecule/install/molecule.yml +++ b/tripleo_ansible/roles/tripleo_podman/molecule/install/molecule.yml @@ -37,6 +37,8 @@ provisioner: env: ANSIBLE_STDOUT_CALLBACK: yaml ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: test_sequence: diff --git a/tripleo_ansible/roles/tripleo_podman/molecule/login/molecule.yml b/tripleo_ansible/roles/tripleo_podman/molecule/login/molecule.yml index faf389d6a..0aaf9bd42 100644 --- a/tripleo_ansible/roles/tripleo_podman/molecule/login/molecule.yml +++ b/tripleo_ansible/roles/tripleo_podman/molecule/login/molecule.yml @@ -37,6 +37,8 @@ provisioner: env: ANSIBLE_STDOUT_CALLBACK: yaml ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" + ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" + ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}" scenario: test_sequence: diff --git a/tripleo_ansible/roles/tripleo_podman/molecule/login/prepare.yml b/tripleo_ansible/roles/tripleo_podman/molecule/login/prepare.yml index bbce15d9a..1c79b19fb 100644 --- a/tripleo_ansible/roles/tripleo_podman/molecule/login/prepare.yml +++ b/tripleo_ansible/roles/tripleo_podman/molecule/login/prepare.yml @@ -17,7 +17,6 @@ - name: Prepare hosts: all - become: true gather_facts: true pre_tasks: - name: set basic user fact @@ -34,29 +33,32 @@ roles: - role: test_deps - - role: ensure-docker tasks: - - name: Create a docker registry - become: true + - name: Create registry shell: |- - docker pull ubuntu:16.04 - docker tag ubuntu:16.04 localhost:5000/my-ubuntu - mkdir auth - docker run --entrypoint htpasswd registry:2 -Bbn testuser testpassword > auth/htpasswd - docker container stop registry - docker run -d -p 5000:5000 --restart=always \ + podman container rm --force registry || true + podman pull ubuntu:16.04 + podman tag ubuntu:16.04 localhost:5000/my-ubuntu + mkdir -p {{ ansible_user_dir }}/auth + podman run --entrypoint htpasswd registry:2 -Bbn testuser testpassword > {{ ansible_user_dir }}/auth/htpasswd + podman run -d -p 5000:5000 --restart=always \ --name registry \ - -v "$(pwd)"/auth:/auth \ + -v "{{ ansible_user_dir }}/auth:/auth" \ -e "REGISTRY_AUTH=htpasswd" \ -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \ -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \ registry:2 args: - creates: /root/auth/htpasswd + executable: /bin/bash - name: Run install include_role: name: tripleo_podman tasks_from: tripleo_podman_install.yml vars_from: "redhat.yml" + + - name: Disable SELinux + become: true + selinux: + state: disabled diff --git a/tripleo_ansible/roles/tripleo_ptp/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_ptp/molecule/default/molecule.yml index 0afa62b6c..7b475b198 100644 --- a/tripleo_ansible/roles/tripleo_ptp/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_ptp/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,13 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - - ALL # CENT7 requires all due to the age of the software + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -35,16 +33,12 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - - SYS_ADMIN + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_ptp/molecule/ntp_stop/molecule.yml b/tripleo_ansible/roles/tripleo_ptp/molecule/ntp_stop/molecule.yml index 35c682709..55f7b086d 100644 --- a/tripleo_ansible/roles/tripleo_ptp/molecule/ntp_stop/molecule.yml +++ b/tripleo_ansible/roles/tripleo_ptp/molecule/ntp_stop/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,13 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - - ALL # CENT7 requires all due to the age of the software + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_puppet_cache/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_puppet_cache/molecule/default/molecule.yml index 78971ff18..8d3c2ab1e 100644 --- a/tripleo_ansible/roles/tripleo_puppet_cache/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_puppet_cache/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_securetty/molecule/create/molecule.yml b/tripleo_ansible/roles/tripleo_securetty/molecule/create/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/tripleo_securetty/molecule/create/molecule.yml +++ b/tripleo_ansible/roles/tripleo_securetty/molecule/create/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_securetty/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_securetty/molecule/default/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/tripleo_securetty/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_securetty/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_ssh_known_hosts/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_ssh_known_hosts/molecule/default/molecule.yml index 284f0dcdd..912db23d4 100644 --- a/tripleo_ansible/roles/tripleo_ssh_known_hosts/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_ssh_known_hosts/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_ssh_known_hosts/molecule/no_networks/molecule.yml b/tripleo_ansible/roles/tripleo_ssh_known_hosts/molecule/no_networks/molecule.yml index d14effcb0..d34f4ee1f 100644 --- a/tripleo_ansible/roles/tripleo_ssh_known_hosts/molecule/no_networks/molecule.yml +++ b/tripleo_ansible/roles/tripleo_ssh_known_hosts/molecule/no_networks/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_sshd/molecule/banners/molecule.yml b/tripleo_ansible/roles/tripleo_sshd/molecule/banners/molecule.yml index 60c0b1e47..e5726bbbf 100644 --- a/tripleo_ansible/roles/tripleo_sshd/molecule/banners/molecule.yml +++ b/tripleo_ansible/roles/tripleo_sshd/molecule/banners/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,13 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - - ALL # CENT7 requires all due to the age of the software + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -35,16 +33,12 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - - SYS_ADMIN + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_sshd/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_sshd/molecule/default/molecule.yml index 60c0b1e47..e5726bbbf 100644 --- a/tripleo_ansible/roles/tripleo_sshd/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_sshd/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,13 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - - ALL # CENT7 requires all due to the age of the software + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -35,16 +33,12 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - - SYS_ADMIN + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_systemd_wrapper/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_systemd_wrapper/molecule/default/molecule.yml index c9950389d..8839cf4db 100644 --- a/tripleo_ansible/roles/tripleo_systemd_wrapper/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_systemd_wrapper/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -18,10 +18,13 @@ platforms: # needed for systemd stuff command: /sbin/init capabilities: - - SYS_ADMIN + - ALL volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -33,10 +36,12 @@ platforms: # needed for systemd stuff command: /sbin/init capabilities: - - SYS_ADMIN + - ALL volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_timezone/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_timezone/molecule/default/molecule.yml index 5e740d2a6..0c8cb80f6 100644 --- a/tripleo_ansible/roles/tripleo_timezone/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_timezone/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,13 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - - ALL # CENT7 requires all due to the age of the software + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -35,16 +33,12 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp capabilities: - - SYS_ADMIN + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_transfer/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_transfer/molecule/default/molecule.yml index c4f92227a..c251212fd 100644 --- a/tripleo_ansible/roles/tripleo_transfer/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_transfer/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -16,15 +16,13 @@ platforms: http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - - ALL # CENT7 requires all due to the age of the software + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: &ulimit + - host - name: overcloud-controller-1 hostname: overcloud-controller-1 @@ -36,15 +34,12 @@ platforms: environment: <<: *env command: /sbin/init - tmpfs: - - /run - - /tmp capabilities: - - ALL # CENT7 requires all due to the age of the software + - ALL volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + privileged: true + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_upgrade_hiera/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_upgrade_hiera/molecule/default/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/tripleo_upgrade_hiera/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_upgrade_hiera/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tripleo_validations_package/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_validations_package/molecule/default/molecule.yml index d89bc3268..42b52b06a 100644 --- a/tripleo_ansible/roles/tripleo_validations_package/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_validations_package/molecule/default/molecule.yml @@ -1,6 +1,6 @@ --- driver: - name: docker + name: podman log: true @@ -17,6 +17,8 @@ platforms: environment: &env http_proxy: "{{ lookup('env', 'http_proxy') }}" https_proxy: "{{ lookup('env', 'https_proxy') }}" + ulimits: &ulimit + - host - name: centos8 hostname: centos8 @@ -27,6 +29,7 @@ platforms: - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro environment: <<: *env + ulimits: *ulimit provisioner: name: ansible diff --git a/tripleo_ansible/roles/tuned/molecule/default/Dockerfile b/tripleo_ansible/roles/tuned/molecule/default/Dockerfile deleted file mode 100644 index 8943173f9..000000000 --- a/tripleo_ansible/roles/tuned/molecule/default/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -# Molecule managed -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -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 {{ 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/tripleo_ansible/roles/tuned/molecule/default/converge.yml b/tripleo_ansible/roles/tuned/molecule/default/converge.yml index 6f35fd6cf..45625df67 100644 --- a/tripleo_ansible/roles/tuned/molecule/default/converge.yml +++ b/tripleo_ansible/roles/tuned/molecule/default/converge.yml @@ -16,6 +16,7 @@ - name: Converge + become: true hosts: all roles: - role: "tuned" diff --git a/tripleo_ansible/roles/tuned/molecule/default/molecule.yml b/tripleo_ansible/roles/tuned/molecule/default/molecule.yml index 68ab4eaca..faf389d6a 100644 --- a/tripleo_ansible/roles/tuned/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tuned/molecule/default/molecule.yml @@ -1,65 +1,48 @@ --- driver: - name: docker + name: delegated + options: + managed: false + login_cmd_template: >- + ssh + -o UserKnownHostsFile=/dev/null + -o StrictHostKeyChecking=no + -o Compression=no + -o TCPKeepAlive=yes + -o VerifyHostKeyDNS=no + -o ForwardX11=no + -o ForwardAgent=no + {instance} + ansible_connection_options: + ansible_connection: ssh log: true platforms: - - name: centos7 - hostname: centos7 - image: centos:7 - dockerfile: Dockerfile - pkg_extras: python-setuptools - easy_install: - - pip - environment: &env - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" - command: /sbin/init - tmpfs: - - /run - - /tmp - capabilities: - - ALL # CENT7 requires all due to the age of the software - volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - - name: centos8 - hostname: centos8 - image: centos:8 - dockerfile: Dockerfile - pkg_extras: python*-setuptools - environment: - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" - command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp - capabilities: - - SYS_ADMIN - volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + - name: instance provisioner: name: ansible + config_options: + defaults: + fact_caching: jsonfile + fact_caching_connection: /tmp/molecule/facts + inventory: + hosts: + all: + hosts: + instance: + ansible_host: localhost log: true env: ANSIBLE_STDOUT_CALLBACK: yaml + ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" scenario: test_sequence: - - destroy - - create - prepare - converge - - verify - - destroy + - check verifier: name: testinfra diff --git a/tripleo_ansible/roles/tuned/molecule/isolated/Dockerfile b/tripleo_ansible/roles/tuned/molecule/isolated/Dockerfile deleted file mode 100644 index 8943173f9..000000000 --- a/tripleo_ansible/roles/tuned/molecule/isolated/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -# Molecule managed -# Copyright 2019 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -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 {{ 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/tripleo_ansible/roles/tuned/molecule/isolated/converge.yml b/tripleo_ansible/roles/tuned/molecule/isolated/converge.yml index 6a5915688..cd5049849 100644 --- a/tripleo_ansible/roles/tuned/molecule/isolated/converge.yml +++ b/tripleo_ansible/roles/tuned/molecule/isolated/converge.yml @@ -16,6 +16,7 @@ - name: Converge + become: true hosts: all vars: tuned_system_packages: "tuned-profiles-cpu-partitioning" diff --git a/tripleo_ansible/roles/tuned/molecule/isolated/molecule.yml b/tripleo_ansible/roles/tuned/molecule/isolated/molecule.yml index 68ab4eaca..faf389d6a 100644 --- a/tripleo_ansible/roles/tuned/molecule/isolated/molecule.yml +++ b/tripleo_ansible/roles/tuned/molecule/isolated/molecule.yml @@ -1,65 +1,48 @@ --- driver: - name: docker + name: delegated + options: + managed: false + login_cmd_template: >- + ssh + -o UserKnownHostsFile=/dev/null + -o StrictHostKeyChecking=no + -o Compression=no + -o TCPKeepAlive=yes + -o VerifyHostKeyDNS=no + -o ForwardX11=no + -o ForwardAgent=no + {instance} + ansible_connection_options: + ansible_connection: ssh log: true platforms: - - name: centos7 - hostname: centos7 - image: centos:7 - dockerfile: Dockerfile - pkg_extras: python-setuptools - easy_install: - - pip - environment: &env - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" - command: /sbin/init - tmpfs: - - /run - - /tmp - capabilities: - - ALL # CENT7 requires all due to the age of the software - volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - - name: centos8 - hostname: centos8 - image: centos:8 - dockerfile: Dockerfile - pkg_extras: python*-setuptools - environment: - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" - command: /sbin/init - privileged: true - tmpfs: - - /run - - /tmp - capabilities: - - SYS_ADMIN - volumes: - - /run/udev:/run/udev:ro - - /sys/fs/cgroup:/sys/fs/cgroup:ro - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro + - name: instance provisioner: name: ansible + config_options: + defaults: + fact_caching: jsonfile + fact_caching_connection: /tmp/molecule/facts + inventory: + hosts: + all: + hosts: + instance: + ansible_host: localhost log: true env: ANSIBLE_STDOUT_CALLBACK: yaml + ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" scenario: test_sequence: - - destroy - - create - prepare - converge - - verify - - destroy + - check verifier: name: testinfra diff --git a/zuul.d/layout.yaml b/zuul.d/layout.yaml index 381ada020..c494a3527 100644 --- a/zuul.d/layout.yaml +++ b/zuul.d/layout.yaml @@ -24,22 +24,24 @@ - .*.rst$ - .*.txt$ - ^_skeleton_role_/.* + - ^scripts/.* + - ^tox.ini$ + - ^tripleo_ansible/playbooks/docker-vfs-setup.yml$ - ^tripleo_ansible/.*molecule.* - ^tripleo_ansible/.*meta.* - ^tripleo_ansible/roles/test_deps/.* + - ^zuul.d/.* - tripleo-ci-centos-8-standalone: &basic_standalone dependencies: *deps files: *containers_files irrelevant-files: *irrelevant_scenario_files - tripleo-ci-centos-8-containers-undercloud-minion: &undercloud_minion dependencies: *deps - files: - - ^tripleo_ansible/.* + files: *containers_files irrelevant-files: *irrelevant_scenario_files - tripleo-ci-centos-8-undercloud-containers: &undercloud_containers dependencies: *deps - files: - - ^tripleo_ansible/.* + files: *containers_files irrelevant-files: *irrelevant_scenario_files - tripleo-ci-centos-8-scenario001-standalone: &scenario001 dependencies: *deps diff --git a/zuul.d/playbooks/pre.yml b/zuul.d/playbooks/pre.yml index d651d69f8..7f445a113 100644 --- a/zuul.d/playbooks/pre.yml +++ b/zuul.d/playbooks/pre.yml @@ -41,14 +41,45 @@ . {{ ansible_user_dir }}/test-python/bin/activate pip freeze - # NOTE(cloudnull): This is being done because docker is not supported on RHEL-8 - # and tests within this repo still require docker. - - name: Manual install container.io + - name: Basic ci setup become: true - package: - name: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm - when: - - (ansible_distribution_major_version | int) >= 8 + block: + - name: Ensure ci directories + file: + path: "/etc/ci" + state: "directory" + + - name: Ensure ci mirror file + file: + path: "/etc/ci/mirror_info.sh" + state: "touch" + + - name: Set an appropriate fs.file-max + sysctl: + name: fs.file-max + value: 2048000 + sysctl_set: true + state: present + reload: true + + - name: Set container_manage_cgroup boolean + seboolean: + name: container_manage_cgroup + state: true + persistent: true + failed_when: false + + - name: Create limits file for containers + copy: + content: | + * soft nofile 102400 + * hard nofile 204800 + * soft nproc 2048 + * hard nproc 4096 + dest: /etc/security/limits.d/containers.conf + + - name: Reset ssh connection + meta: reset_connection tasks: - name: Get Ansible Galaxy roles command: >- @@ -57,21 +88,3 @@ {{ tripleo_ansible_project_path }}/tripleo_ansible/ansible-role-requirements.yml environment: ANSIBLE_ROLES_PATH: "{{ tripleo_ansible_project_path }}/tripleo_ansible/roles.galaxy" - roles: - # docker is needed by multiple molecule scenarios - - role: ensure-docker - post_tasks: - - name: Run docker vfs setup - shell: |- - . {{ ansible_user_dir }}/test-python/bin/activate - . {{ tripleo_ansible_project_path }}/ansible-test-env.rc - ansible-playbook -i 'localhost,' \ - -e tripleo_docker_enable_vfs={{ tripleo_docker_enable_vfs }} \ - docker-vfs-setup.yml - args: - chdir: "{{ tripleo_ansible_project_path }}/tripleo_ansible/playbooks" - executable: /bin/bash - environment: - ANSIBLE_ACTION_PLUGINS: "{{ tripleo_action_plugins_paths | join(':') }}" - when: - - tripleo_docker_enable_vfs is defined diff --git a/zuul.d/playbooks/run.yml b/zuul.d/playbooks/run.yml index 52cf8bcd4..3becedb4d 100644 --- a/zuul.d/playbooks/run.yml +++ b/zuul.d/playbooks/run.yml @@ -25,6 +25,7 @@ - "{{ tripleo_ansible_project_path }}/tripleo_ansible/roles.galaxy/config_template/action" - "{{ tripleo_ansible_project_path }}/tripleo_ansible/ansible_plugins/action" - "/usr/share/ansible/plugins/action" + tasks: - name: Run role test job shell: |-