diff --git a/bindep.txt b/bindep.txt index a46d33645..e94af23ec 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/tripleo_ansible/roles/test_deps/molecule/default/molecule.yml b/tripleo_ansible/roles/test_deps/molecule/default/molecule.yml index f2b6c89ed..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 @@ -43,10 +46,5 @@ scenario: - verify - destroy -lint: - enabled: false - verifier: name: testinfra - lint: - name: flake8 diff --git a/tripleo_ansible/roles/test_deps/tasks/main.yml b/tripleo_ansible/roles/test_deps/tasks/main.yml index ca2719dd9..8b3ed7c33 100644 --- a/tripleo_ansible/roles/test_deps/tasks/main.yml +++ b/tripleo_ansible/roles/test_deps/tasks/main.yml @@ -61,6 +61,7 @@ state: latest - name: Tripleo setup block + become: true when: - (ansible_os_family | lower) == 'redhat' - test_deps_setup_tripleo | bool 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/molecule.yml b/tripleo_ansible/roles/tripleo-bootstrap/molecule/default/molecule.yml index a16f79a04..99e251515 100644 --- a/tripleo_ansible/roles/tripleo-bootstrap/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo-bootstrap/molecule/default/molecule.yml @@ -1,71 +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 - -lint: - enabled: false verifier: name: testinfra - lint: - name: flake8 diff --git a/tripleo_ansible/roles/tripleo-container-rm/defaults/main.yml b/tripleo_ansible/roles/tripleo-container-rm/defaults/main.yml index dcde62694..efb7691a4 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/molecule.yml b/tripleo_ansible/roles/tripleo-container-rm/molecule/default/molecule.yml index 3706e9368..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,20 +32,14 @@ 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 - check -lint: - enabled: false - verifier: name: testinfra - lint: - name: flake8 diff --git a/tripleo_ansible/roles/tripleo-container-rm/molecule/default/playbook.yml b/tripleo_ansible/roles/tripleo-container-rm/molecule/default/playbook.yml index afbe96bd9..384a047c8 100644 --- a/tripleo_ansible/roles/tripleo-container-rm/molecule/default/playbook.yml +++ b/tripleo_ansible/roles/tripleo-container-rm/molecule/default/playbook.yml @@ -21,9 +21,6 @@ roles: - role: tripleo-container-rm 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 + tripleo_container_cli: podman 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 50966c8b7..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: fedora - 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: fedora - 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/molecule.yml b/tripleo_ansible/roles/tripleo-container-rm/molecule/docker_rm/molecule.yml deleted file mode 100644 index 2d0110561..000000000 --- a/tripleo_ansible/roles/tripleo-container-rm/molecule/docker_rm/molecule.yml +++ /dev/null @@ -1,55 +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" - ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" - -scenario: - name: docker - test_sequence: - - prepare - - converge - - check - -lint: - enabled: false - -verifier: - name: testinfra - lint: - name: flake8 diff --git a/tripleo_ansible/roles/tripleo-container-rm/molecule/docker_rm/playbook.yml b/tripleo_ansible/roles/tripleo-container-rm/molecule/docker_rm/playbook.yml deleted file mode 100644 index d664f416e..000000000 --- a/tripleo_ansible/roles/tripleo-container-rm/molecule/docker_rm/playbook.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-docker-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/prepare.yml b/tripleo_ansible/roles/tripleo-container-rm/molecule/docker_rm/prepare.yml deleted file mode 120000 index 1c017d9a2..000000000 --- a/tripleo_ansible/roles/tripleo-container-rm/molecule/docker_rm/prepare.yml +++ /dev/null @@ -1 +0,0 @@ -../default/prepare.yml \ No newline at end of file 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 25df1d98c..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,8 +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: @@ -41,10 +41,5 @@ scenario: - converge - check -lint: - enabled: false - verifier: name: testinfra - lint: - name: flake8 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 25df1d98c..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,8 +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: @@ -41,10 +41,5 @@ scenario: - converge - check -lint: - enabled: false - verifier: name: testinfra - lint: - name: flake8 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 25df1d98c..000000000 --- a/tripleo_ansible/roles/tripleo-container-rm/molecule/podman/molecule.yml +++ /dev/null @@ -1,50 +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 - ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" - ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}" - -scenario: - test_sequence: - - prepare - - converge - - check - -lint: - enabled: false - -verifier: - name: testinfra - lint: - name: flake8 diff --git a/tripleo_ansible/roles/tripleo-container-rm/molecule/podman/playbook.yml b/tripleo_ansible/roles/tripleo-container-rm/molecule/podman/playbook.yml deleted file mode 100644 index 9ca7cb89f..000000000 --- a/tripleo_ansible/roles/tripleo-container-rm/molecule/podman/playbook.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/prepare.yml b/tripleo_ansible/roles/tripleo-container-rm/molecule/podman/prepare.yml deleted file mode 100644 index adeef81c5..000000000 --- a/tripleo_ansible/roles/tripleo-container-rm/molecule/podman/prepare.yml +++ /dev/null @@ -1,48 +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 - podman_image: - name: fedora - - - name: Create test containers - podman_container: - name: "{{ item }}" - interactive: true - tty: true - detach: true - image: fedora - command: 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 0d6a9fcc4..d90e356e7 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/molecule.yml b/tripleo_ansible/roles/tripleo-container-tag/molecule/default/molecule.yml index 4237a6801..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: @@ -44,10 +41,5 @@ scenario: - converge - check -lint: - enabled: false - verifier: name: testinfra - lint: - name: flake8 diff --git a/tripleo_ansible/roles/tripleo-container-tag/molecule/default/playbook.yml b/tripleo_ansible/roles/tripleo-container-tag/molecule/default/playbook.yml index 9c9529931..4dfd7061a 100644 --- a/tripleo_ansible/roles/tripleo-container-tag/molecule/default/playbook.yml +++ b/tripleo_ansible/roles/tripleo-container-tag/molecule/default/playbook.yml @@ -22,10 +22,9 @@ - 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/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/podman/molecule.yml b/tripleo_ansible/roles/tripleo-container-tag/molecule/podman/molecule.yml deleted file mode 100644 index 4b46f61e5..000000000 --- a/tripleo_ansible/roles/tripleo-container-tag/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 - inventory: - hosts: - all: - hosts: - instance: - ansible_host: localhost - log: true - env: - ANSIBLE_STDOUT_CALLBACK: yaml - -scenario: - test_sequence: - - prepare - - converge - - check - -lint: - enabled: false - -verifier: - name: testinfra - lint: - name: flake8 diff --git a/tripleo_ansible/roles/tripleo-container-tag/molecule/podman/playbook.yml b/tripleo_ansible/roles/tripleo-container-tag/molecule/podman/playbook.yml deleted file mode 100644 index 7169f9684..000000000 --- a/tripleo_ansible/roles/tripleo-container-tag/molecule/podman/playbook.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/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-module-load/molecule/default/Dockerfile b/tripleo_ansible/roles/tripleo-module-load/molecule/default/Dockerfile deleted file mode 100644 index e0534b4d1..000000000 --- a/tripleo_ansible/roles/tripleo-module-load/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-module-load/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo-module-load/molecule/default/molecule.yml index b4b6b53c9..faf389d6a 100644 --- a/tripleo_ansible/roles/tripleo-module-load/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo-module-load/molecule/default/molecule.yml @@ -1,69 +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 - volumes: - - /dev:/dev - - /lib/modules:/lib/modules - - - name: fedora28 - hostname: fedora28 - image: fedora:28 - 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: - - ALL - volumes: - - /dev:/dev - - /lib/modules:/lib/modules + - 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 - check - - verify - - destroy - -lint: - enabled: false verifier: name: testinfra - lint: - name: flake8 diff --git a/tripleo_ansible/roles/tripleo-module-load/molecule/default/prepare.yml b/tripleo_ansible/roles/tripleo-module-load/molecule/default/prepare.yml index eaca6e17c..2faa7d2a0 100644 --- a/tripleo_ansible/roles/tripleo-module-load/molecule/default/prepare.yml +++ b/tripleo_ansible/roles/tripleo-module-load/molecule/default/prepare.yml @@ -21,6 +21,7 @@ - role: test_deps post_tasks: - name: Install additional dependencies + become: true package: name: kmod state: present diff --git a/tripleo_ansible/roles/tripleo-module-load/molecule/legacy_vars/molecule.yml b/tripleo_ansible/roles/tripleo-module-load/molecule/legacy_vars/molecule.yml index b4b6b53c9..faf389d6a 100644 --- a/tripleo_ansible/roles/tripleo-module-load/molecule/legacy_vars/molecule.yml +++ b/tripleo_ansible/roles/tripleo-module-load/molecule/legacy_vars/molecule.yml @@ -1,69 +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 - volumes: - - /dev:/dev - - /lib/modules:/lib/modules - - - name: fedora28 - hostname: fedora28 - image: fedora:28 - 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: - - ALL - volumes: - - /dev:/dev - - /lib/modules:/lib/modules + - 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 - check - - verify - - destroy - -lint: - enabled: false verifier: name: testinfra - lint: - name: flake8 diff --git a/tripleo_ansible/roles/tripleo-module-load/molecule/legacy_vars/prepare.yml b/tripleo_ansible/roles/tripleo-module-load/molecule/legacy_vars/prepare.yml index eaca6e17c..2faa7d2a0 100644 --- a/tripleo_ansible/roles/tripleo-module-load/molecule/legacy_vars/prepare.yml +++ b/tripleo_ansible/roles/tripleo-module-load/molecule/legacy_vars/prepare.yml @@ -21,6 +21,7 @@ - role: test_deps post_tasks: - name: Install additional dependencies + become: true package: name: kmod state: present diff --git a/tripleo_ansible/roles/tripleo-module-load/molecule/remove_module/molecule.yml b/tripleo_ansible/roles/tripleo-module-load/molecule/remove_module/molecule.yml index b4b6b53c9..99e568f29 100644 --- a/tripleo_ansible/roles/tripleo-module-load/molecule/remove_module/molecule.yml +++ b/tripleo_ansible/roles/tripleo-module-load/molecule/remove_module/molecule.yml @@ -1,69 +1,49 @@ --- 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 - volumes: - - /dev:/dev - - /lib/modules:/lib/modules - - - name: fedora28 - hostname: fedora28 - image: fedora:28 - 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: - - ALL - volumes: - - /dev:/dev - - /lib/modules:/lib/modules + - 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: + name: remove_module test_sequence: - - destroy - - create - prepare - converge - check - - verify - - destroy - -lint: - enabled: false verifier: name: testinfra - lint: - name: flake8 diff --git a/tripleo_ansible/roles/tripleo-module-load/molecule/remove_module/prepare.yml b/tripleo_ansible/roles/tripleo-module-load/molecule/remove_module/prepare.yml index eaca6e17c..2faa7d2a0 100644 --- a/tripleo_ansible/roles/tripleo-module-load/molecule/remove_module/prepare.yml +++ b/tripleo_ansible/roles/tripleo-module-load/molecule/remove_module/prepare.yml @@ -21,6 +21,7 @@ - role: test_deps post_tasks: - name: Install additional dependencies + become: true package: name: kmod state: present diff --git a/zuul.d/molecule.yaml b/zuul.d/molecule.yaml index 99789c1f1..251fc436e 100644 --- a/zuul.d/molecule.yaml +++ b/zuul.d/molecule.yaml @@ -5,14 +5,14 @@ - tripleo-ansible-centos-8-molecule-aide - tripleo-ansible-centos-8-molecule-test_deps - tripleo-ansible-centos-8-molecule-test_package_action - - tripleo-ansible-centos-7-molecule-tripleo-bootstrap + - tripleo-ansible-centos-8-molecule-tripleo-bootstrap - tripleo-ansible-centos-8-molecule-tuned - tripleo-ansible-centos-8-role-addition - tripleo-ansible-centos-8-molecule-tripleo-create-admin - - tripleo-ansible-centos-7-molecule-tripleo-module-load + - tripleo-ansible-centos-8-molecule-tripleo-module-load - tripleo-ansible-centos-8-molecule-tripleo-ssh-known-hosts - - tripleo-ansible-centos-7-molecule-tripleo-container-tag - - tripleo-ansible-centos-7-molecule-tripleo-container-rm + - tripleo-ansible-centos-8-molecule-tripleo-container-tag + - tripleo-ansible-centos-8-molecule-tripleo-container-rm - tripleo-ansible-centos-8-molecule-tripleo-image-serve - tripleo-ansible-centos-8-molecule-tripleo-transfer - tripleo-ansible-centos-7-molecule-tripleo-podman @@ -52,14 +52,14 @@ - tripleo-ansible-centos-8-molecule-aide - tripleo-ansible-centos-8-molecule-test_deps - tripleo-ansible-centos-8-molecule-test_package_action - - tripleo-ansible-centos-7-molecule-tripleo-bootstrap + - tripleo-ansible-centos-8-molecule-tripleo-bootstrap - tripleo-ansible-centos-8-molecule-tuned - tripleo-ansible-centos-8-role-addition - tripleo-ansible-centos-8-molecule-tripleo-create-admin - - tripleo-ansible-centos-7-molecule-tripleo-module-load + - tripleo-ansible-centos-8-molecule-tripleo-module-load - tripleo-ansible-centos-8-molecule-tripleo-ssh-known-hosts - - tripleo-ansible-centos-7-molecule-tripleo-container-tag - - tripleo-ansible-centos-7-molecule-tripleo-container-rm + - tripleo-ansible-centos-8-molecule-tripleo-container-tag + - tripleo-ansible-centos-8-molecule-tripleo-container-rm - tripleo-ansible-centos-8-molecule-tripleo-image-serve - tripleo-ansible-centos-8-molecule-tripleo-transfer - tripleo-ansible-centos-7-molecule-tripleo-podman @@ -120,8 +120,8 @@ - job: files: - ^tripleo_ansible/roles/tripleo-bootstrap/.* - name: tripleo-ansible-centos-7-molecule-tripleo-bootstrap - parent: tripleo-ansible-centos-7-base + name: tripleo-ansible-centos-8-molecule-tripleo-bootstrap + parent: tripleo-ansible-centos-8-base vars: tripleo_role_name: tripleo-bootstrap - job: @@ -152,8 +152,8 @@ - job: files: - ^tripleo_ansible/roles/tripleo-module-load/.* - name: tripleo-ansible-centos-7-molecule-tripleo-module-load - parent: tripleo-ansible-centos-7-base + name: tripleo-ansible-centos-8-molecule-tripleo-module-load + parent: tripleo-ansible-centos-8-base vars: tripleo_role_name: tripleo-module-load - job: @@ -166,15 +166,15 @@ - job: files: - ^tripleo_ansible/roles/tripleo-container-tag/.* - name: tripleo-ansible-centos-7-molecule-tripleo-container-tag - parent: tripleo-ansible-centos-7-base + name: tripleo-ansible-centos-8-molecule-tripleo-container-tag + parent: tripleo-ansible-centos-8-base vars: tripleo_role_name: tripleo-container-tag - job: files: - ^tripleo_ansible/roles/tripleo-container-rm/.* - name: tripleo-ansible-centos-7-molecule-tripleo-container-rm - parent: tripleo-ansible-centos-7-base + name: tripleo-ansible-centos-8-molecule-tripleo-container-rm + parent: tripleo-ansible-centos-8-base vars: tripleo_role_name: tripleo-container-rm - job: