diff --git a/tripleo_ansible/roles/tripleo_transfer/molecule/default/Dockerfile b/tripleo_ansible/roles/tripleo_transfer/molecule/default/Dockerfile deleted file mode 100644 index e0534b4d1..000000000 --- a/tripleo_ansible/roles/tripleo_transfer/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_transfer/molecule/default/converge.yml b/tripleo_ansible/roles/tripleo_transfer/molecule/default/converge.yml index 00e8cff07..de74d12f8 100644 --- a/tripleo_ansible/roles/tripleo_transfer/molecule/default/converge.yml +++ b/tripleo_ansible/roles/tripleo_transfer/molecule/default/converge.yml @@ -16,11 +16,13 @@ - name: Converge - hosts: all + hosts: localhost + connection: local + any_errors_fatal: true roles: - role: "tripleo_transfer" - tripleo_transfer_src_host: overcloud-controller-0 + tripleo_transfer_src_host: controller2 tripleo_transfer_src_dir: /etc - tripleo_transfer_dest_host: overcloud-controller-1 + tripleo_transfer_dest_host: controller1 tripleo_transfer_dest_dir: /opt/etc-target tripleo_transfer_storage_root_dir: /tmp/transfer-staging diff --git a/tripleo_ansible/roles/tripleo_transfer/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo_transfer/molecule/default/molecule.yml index 604e2d1dc..589349cd1 100644 --- a/tripleo_ansible/roles/tripleo_transfer/molecule/default/molecule.yml +++ b/tripleo_ansible/roles/tripleo_transfer/molecule/default/molecule.yml @@ -1,67 +1,48 @@ --- driver: - name: podman + 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: overcloud-controller-0 - hostname: overcloud-controller-0 - image: ubi8/ubi-init - registry: - url: registry.access.redhat.com - dockerfile: Dockerfile - pkg_extras: python*setuptools - command: /sbin/init - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg - - /opt/yum.repos.d:/etc/yum.repos.d:rw - privileged: true - environment: - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" - ulimits: - - host - - - name: overcloud-controller-1 - hostname: overcloud-controller-1 - image: ubi8/ubi-init - registry: - url: registry.access.redhat.com - dockerfile: Dockerfile - pkg_extras: python*setuptools - command: /sbin/init - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro - - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro - - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg - - /opt/yum.repos.d:/etc/yum.repos.d:rw - privileged: true - environment: - http_proxy: "{{ lookup('env', 'http_proxy') }}" - https_proxy: "{{ lookup('env', 'https_proxy') }}" - ulimits: - - host + - name: controller1 + - name: controller2 provisioner: name: ansible + config_options: + defaults: + fact_caching: jsonfile + fact_caching_connection: /tmp/molecule/facts inventory: - vars: - ansible_python_interpreter: /usr/bin/python3 + hosts: + all: + hosts: + controller1: + ansible_host: 127.0.0.2 + controller2: + ansible_host: 127.0.0.3 log: true env: ANSIBLE_STDOUT_CALLBACK: yaml scenario: test_sequence: - - destroy - - create - - prepare - converge - - verify - - destroy verifier: name: testinfra diff --git a/tripleo_ansible/roles/tripleo_transfer/molecule/default/prepare.yml b/tripleo_ansible/roles/tripleo_transfer/molecule/default/prepare.yml deleted file mode 100644 index 109fafa08..000000000 --- a/tripleo_ansible/roles/tripleo_transfer/molecule/default/prepare.yml +++ /dev/null @@ -1,22 +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 - roles: - - role: test_deps