Browse Source

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 <kecarter@redhat.com>
tags/1.4.0
Kevin Carter 2 months ago
parent
commit
74f2f81870
100 changed files with 434 additions and 1156 deletions
  1. +4
    -1
      _skeleton_role_/molecule/default/molecule.yml
  2. +1
    -0
      bindep.txt
  3. +0
    -1
      molecule-requirements.txt
  4. +4
    -0
      scripts/run-local-test
  5. +0
    -8
      tools/test-setup.sh
  6. +1
    -1
      tox.ini
  7. +4
    -1
      tripleo_ansible/roles/aide/molecule/default/molecule.yml
  8. +1
    -1
      tripleo_ansible/roles/backup_and_restore/defaults/main.yml
  9. +0
    -37
      tripleo_ansible/roles/backup_and_restore/molecule/default/Dockerfile
  10. +0
    -2
      tripleo_ansible/roles/backup_and_restore/molecule/default/converge.yml
  11. +2
    -0
      tripleo_ansible/roles/backup_and_restore/molecule/default/molecule.yml
  12. +20
    -48
      tripleo_ansible/roles/backup_and_restore/molecule/default/prepare.yml
  13. +4
    -1
      tripleo_ansible/roles/login_defs/molecule/default/molecule.yml
  14. +4
    -1
      tripleo_ansible/roles/test_deps/molecule/default/molecule.yml
  15. +3
    -0
      tripleo_ansible/roles/test_deps/tasks/tripleo-setup.yml
  16. +4
    -1
      tripleo_ansible/roles/test_package_action/molecule/default/molecule.yml
  17. +4
    -1
      tripleo_ansible/roles/test_package_action/molecule/negative/molecule.yml
  18. +4
    -1
      tripleo_ansible/roles/test_package_action/molecule/positive/molecule.yml
  19. +0
    -37
      tripleo_ansible/roles/tripleo_bootstrap/molecule/default/Dockerfile
  20. +1
    -0
      tripleo_ansible/roles/tripleo_bootstrap/molecule/default/converge.yml
  21. +24
    -45
      tripleo_ansible/roles/tripleo_bootstrap/molecule/default/molecule.yml
  22. +1
    -3
      tripleo_ansible/roles/tripleo_bootstrap/tasks/main.yml
  23. +4
    -1
      tripleo_ansible/roles/tripleo_cellv2/molecule/default/molecule.yml
  24. +4
    -1
      tripleo_ansible/roles/tripleo_ceph_common/molecule/default/molecule.yml
  25. +4
    -1
      tripleo_ansible/roles/tripleo_ceph_run_ansible/molecule/default/molecule.yml
  26. +4
    -1
      tripleo_ansible/roles/tripleo_ceph_uuid/molecule/default/molecule.yml
  27. +4
    -1
      tripleo_ansible/roles/tripleo_ceph_work_dir/molecule/default/molecule.yml
  28. +4
    -1
      tripleo_ansible/roles/tripleo_clients_install/molecule/default/molecule.yml
  29. +4
    -1
      tripleo_ansible/roles/tripleo_config/molecule/default/molecule.yml
  30. +4
    -1
      tripleo_ansible/roles/tripleo_container_image_prepare/molecule/default/molecule.yml
  31. +1
    -1
      tripleo_ansible/roles/tripleo_container_rm/defaults/main.yml
  32. +3
    -6
      tripleo_ansible/roles/tripleo_container_rm/molecule/default/converge.yml
  33. +2
    -6
      tripleo_ansible/roles/tripleo_container_rm/molecule/default/molecule.yml
  34. +14
    -49
      tripleo_ansible/roles/tripleo_container_rm/molecule/default/prepare.yml
  35. +0
    -33
      tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/converge.yml
  36. +0
    -48
      tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/molecule.yml
  37. +2
    -0
      tripleo_ansible/roles/tripleo_container_rm/molecule/legacy_vars/molecule.yml
  38. +2
    -0
      tripleo_ansible/roles/tripleo_container_rm/molecule/podman-rm-stopped/molecule.yml
  39. +0
    -26
      tripleo_ansible/roles/tripleo_container_rm/molecule/podman/converge.yml
  40. +0
    -43
      tripleo_ansible/roles/tripleo_container_rm/molecule/podman/molecule.yml
  41. +0
    -41
      tripleo_ansible/roles/tripleo_container_rm/molecule/podman/prepare.yml
  42. +0
    -37
      tripleo_ansible/roles/tripleo_container_stop/molecule/default/Dockerfile
  43. +2
    -4
      tripleo_ansible/roles/tripleo_container_stop/molecule/default/converge.yml
  44. +2
    -0
      tripleo_ansible/roles/tripleo_container_stop/molecule/default/molecule.yml
  45. +14
    -49
      tripleo_ansible/roles/tripleo_container_stop/molecule/default/prepare.yml
  46. +0
    -37
      tripleo_ansible/roles/tripleo_container_stop/molecule/podman/Dockerfile
  47. +0
    -27
      tripleo_ansible/roles/tripleo_container_stop/molecule/podman/converge.yml
  48. +0
    -48
      tripleo_ansible/roles/tripleo_container_stop/molecule/podman/molecule.yml
  49. +0
    -41
      tripleo_ansible/roles/tripleo_container_stop/molecule/podman/prepare.yml
  50. +1
    -1
      tripleo_ansible/roles/tripleo_container_tag/defaults/main.yml
  51. +3
    -4
      tripleo_ansible/roles/tripleo_container_tag/molecule/default/converge.yml
  52. +2
    -5
      tripleo_ansible/roles/tripleo_container_tag/molecule/default/molecule.yml
  53. +8
    -47
      tripleo_ansible/roles/tripleo_container_tag/molecule/default/prepare.yml
  54. +2
    -0
      tripleo_ansible/roles/tripleo_container_tag/molecule/legacy_vars/molecule.yml
  55. +0
    -30
      tripleo_ansible/roles/tripleo_container_tag/molecule/podman/converge.yml
  56. +0
    -43
      tripleo_ansible/roles/tripleo_container_tag/molecule/podman/molecule.yml
  57. +0
    -32
      tripleo_ansible/roles/tripleo_container_tag/molecule/podman/prepare.yml
  58. +4
    -1
      tripleo_ansible/roles/tripleo_create_admin/molecule/addkey/molecule.yml
  59. +4
    -1
      tripleo_ansible/roles/tripleo_create_admin/molecule/default/molecule.yml
  60. +4
    -1
      tripleo_ansible/roles/tripleo_create_admin/molecule/keygen/molecule.yml
  61. +1
    -1
      tripleo_ansible/roles/tripleo_hieradata/molecule/ansible_hieradata/molecule.yml
  62. +4
    -1
      tripleo_ansible/roles/tripleo_hieradata/molecule/default/molecule.yml
  63. +4
    -1
      tripleo_ansible/roles/tripleo_hieradata/molecule/hieradata_vars/molecule.yml
  64. +4
    -1
      tripleo_ansible/roles/tripleo_hosts_entries/molecule/default/molecule.yml
  65. +8
    -14
      tripleo_ansible/roles/tripleo_image_serve/molecule/default/molecule.yml
  66. +8
    -14
      tripleo_ansible/roles/tripleo_image_serve/molecule/legacy_vars/molecule.yml
  67. +1
    -0
      tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/converge.yml
  68. +30
    -17
      tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/molecule.yml
  69. +22
    -19
      tripleo_ansible/roles/tripleo_keystone_resources/molecule/default/prepare.yml
  70. +4
    -1
      tripleo_ansible/roles/tripleo_nova_image_cache/molecule/default/molecule.yml
  71. +1
    -1
      tripleo_ansible/roles/tripleo_nvdimm/molecule/default/molecule.yml
  72. +8
    -11
      tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/default/molecule.yml
  73. +8
    -15
      tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/positive/molecule.yml
  74. +6
    -8
      tripleo_ansible/roles/tripleo_packages/molecule/default/molecule.yml
  75. +6
    -8
      tripleo_ansible/roles/tripleo_packages/molecule/external_upgrade/molecule.yml
  76. +6
    -8
      tripleo_ansible/roles/tripleo_packages/molecule/ffu/molecule.yml
  77. +8
    -5
      tripleo_ansible/roles/tripleo_packages/molecule/update/molecule.yml
  78. +7
    -5
      tripleo_ansible/roles/tripleo_packages/molecule/upgrade/molecule.yml
  79. +4
    -1
      tripleo_ansible/roles/tripleo_persist/molecule/default/molecule.yml
  80. +1
    -1
      tripleo_ansible/roles/tripleo_persist/tasks/cleanup.yml
  81. +2
    -0
      tripleo_ansible/roles/tripleo_podman/molecule/default/molecule.yml
  82. +4
    -31
      tripleo_ansible/roles/tripleo_podman/molecule/default/prepare.yml
  83. +2
    -0
      tripleo_ansible/roles/tripleo_podman/molecule/install/molecule.yml
  84. +2
    -0
      tripleo_ansible/roles/tripleo_podman/molecule/login/molecule.yml
  85. +14
    -12
      tripleo_ansible/roles/tripleo_podman/molecule/login/prepare.yml
  86. +8
    -14
      tripleo_ansible/roles/tripleo_ptp/molecule/default/molecule.yml
  87. +5
    -7
      tripleo_ansible/roles/tripleo_ptp/molecule/ntp_stop/molecule.yml
  88. +4
    -1
      tripleo_ansible/roles/tripleo_puppet_cache/molecule/default/molecule.yml
  89. +4
    -1
      tripleo_ansible/roles/tripleo_securetty/molecule/create/molecule.yml
  90. +4
    -1
      tripleo_ansible/roles/tripleo_securetty/molecule/default/molecule.yml
  91. +4
    -1
      tripleo_ansible/roles/tripleo_ssh_known_hosts/molecule/default/molecule.yml
  92. +4
    -1
      tripleo_ansible/roles/tripleo_ssh_known_hosts/molecule/no_networks/molecule.yml
  93. +8
    -14
      tripleo_ansible/roles/tripleo_sshd/molecule/banners/molecule.yml
  94. +8
    -14
      tripleo_ansible/roles/tripleo_sshd/molecule/default/molecule.yml
  95. +8
    -3
      tripleo_ansible/roles/tripleo_systemd_wrapper/molecule/default/molecule.yml
  96. +8
    -14
      tripleo_ansible/roles/tripleo_timezone/molecule/default/molecule.yml
  97. +8
    -13
      tripleo_ansible/roles/tripleo_transfer/molecule/default/molecule.yml
  98. +4
    -1
      tripleo_ansible/roles/tripleo_upgrade_hiera/molecule/default/molecule.yml
  99. +4
    -1
      tripleo_ansible/roles/tripleo_validations_package/molecule/default/molecule.yml
  100. +0
    -36
      tripleo_ansible/roles/tuned/molecule/default/Dockerfile

+ 4
- 1
_skeleton_role_/molecule/default/molecule.yml View File

@@ -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


+ 1
- 0
bindep.txt View File

@@ -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]


+ 0
- 1
molecule-requirements.txt View File

@@ -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


+ 4
- 0
scripts/run-local-test View File

@@ -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"



+ 0
- 8
tools/test-setup.sh View File

@@ -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

+ 1
- 1
tox.ini View File

@@ -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 \


+ 4
- 1
tripleo_ansible/roles/aide/molecule/default/molecule.yml View File

@@ -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


+ 1
- 1
tripleo_ansible/roles/backup_and_restore/defaults/main.yml View File

@@ -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



+ 0
- 37
tripleo_ansible/roles/backup_and_restore/molecule/default/Dockerfile View File

@@ -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"]

+ 0
- 2
tripleo_ansible/roles/backup_and_restore/molecule/default/converge.yml View File

@@ -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"

+ 2
- 0
tripleo_ansible/roles/backup_and_restore/molecule/default/molecule.yml View File

@@ -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


+ 20
- 48
tripleo_ansible/roles/backup_and_restore/molecule/default/prepare.yml View File

@@ -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)
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
test_deps_extra_packages:
- rear
- syslinux
- genisoimage
- kbd
- puppet
- hiera

post_tasks:
- 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

+ 4
- 1
tripleo_ansible/roles/login_defs/molecule/default/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/test_deps/molecule/default/molecule.yml View File

@@ -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


+ 3
- 0
tripleo_ansible/roles/test_deps/tasks/tripleo-setup.yml View File

@@ -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 }}"


+ 4
- 1
tripleo_ansible/roles/test_package_action/molecule/default/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/test_package_action/molecule/negative/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/test_package_action/molecule/positive/molecule.yml View File

@@ -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


+ 0
- 37
tripleo_ansible/roles/tripleo_bootstrap/molecule/default/Dockerfile View File

@@ -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"]

+ 1
- 0
tripleo_ansible/roles/tripleo_bootstrap/molecule/default/converge.yml View File

@@ -16,6 +16,7 @@


- name: Converge
become: true
hosts: all
roles:
- role: "tripleo_bootstrap"

+ 24
- 45
tripleo_ansible/roles/tripleo_bootstrap/molecule/default/molecule.yml View File

@@ -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

+ 1
- 3
tripleo_ansible/roles/tripleo_bootstrap/tasks/main.yml View File

@@ -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



+ 4
- 1
tripleo_ansible/roles/tripleo_cellv2/molecule/default/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/tripleo_ceph_common/molecule/default/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/tripleo_ceph_run_ansible/molecule/default/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/tripleo_ceph_uuid/molecule/default/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/tripleo_ceph_work_dir/molecule/default/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/tripleo_clients_install/molecule/default/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/tripleo_config/molecule/default/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/tripleo_container_image_prepare/molecule/default/molecule.yml View File

@@ -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


+ 1
- 1
tripleo_ansible/roles/tripleo_container_rm/defaults/main.yml View File

@@ -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([]) }}"

+ 3
- 6
tripleo_ansible/roles/tripleo_container_rm/molecule/default/converge.yml View File

@@ -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

+ 2
- 6
tripleo_ansible/roles/tripleo_container_rm/molecule/default/molecule.yml View File

@@ -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


+ 14
- 49
tripleo_ansible/roles/tripleo_container_rm/molecule/default/prepare.yml View File

@@ -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

+ 0
- 33
tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/converge.yml View File

@@ -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"

+ 0
- 48
tripleo_ansible/roles/tripleo_container_rm/molecule/docker_rm/molecule.yml View File

@@ -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

+ 2
- 0
tripleo_ansible/roles/tripleo_container_rm/molecule/legacy_vars/molecule.yml View File

@@ -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:


+ 2
- 0
tripleo_ansible/roles/tripleo_container_rm/molecule/podman-rm-stopped/molecule.yml View File

@@ -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:


+ 0
- 26
tripleo_ansible/roles/tripleo_container_rm/molecule/podman/converge.yml View File

@@ -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

+ 0
- 43
tripleo_ansible/roles/tripleo_container_rm/molecule/podman/molecule.yml View File

@@ -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

+ 0
- 41
tripleo_ansible/roles/tripleo_container_rm/molecule/podman/prepare.yml View File

@@ -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

+ 0
- 37
tripleo_ansible/roles/tripleo_container_stop/molecule/default/Dockerfile View File

@@ -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"]

+ 2
- 4
tripleo_ansible/roles/tripleo_container_stop/molecule/default/converge.yml View File

@@ -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

+ 2
- 0
tripleo_ansible/roles/tripleo_container_stop/molecule/default/molecule.yml View File

@@ -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:


+ 14
- 49
tripleo_ansible/roles/tripleo_container_stop/molecule/default/prepare.yml View File

@@ -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

+ 0
- 37
tripleo_ansible/roles/tripleo_container_stop/molecule/podman/Dockerfile View File

@@ -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"]

+ 0
- 27
tripleo_ansible/roles/tripleo_container_stop/molecule/podman/converge.yml View File

@@ -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"

+ 0
- 48
tripleo_ansible/roles/tripleo_container_stop/molecule/podman/molecule.yml View File

@@ -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

+ 0
- 41
tripleo_ansible/roles/tripleo_container_stop/molecule/podman/prepare.yml View File

@@ -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

+ 1
- 1
tripleo_ansible/roles/tripleo_container_tag/defaults/main.yml View File

@@ -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) }}"


+ 3
- 4
tripleo_ansible/roles/tripleo_container_tag/molecule/default/converge.yml View File

@@ -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

+ 2
- 5
tripleo_ansible/roles/tripleo_container_tag/molecule/default/molecule.yml View File

@@ -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:


+ 8
- 47
tripleo_ansible/roles/tripleo_container_tag/molecule/default/prepare.yml View File

@@ -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

+ 2
- 0
tripleo_ansible/roles/tripleo_container_tag/molecule/legacy_vars/molecule.yml View File

@@ -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:


+ 0
- 30
tripleo_ansible/roles/tripleo_container_tag/molecule/podman/converge.yml View File

@@ -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

+ 0
- 43
tripleo_ansible/roles/tripleo_container_tag/molecule/podman/molecule.yml View File

@@ -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

+ 0
- 32
tripleo_ansible/roles/tripleo_container_tag/molecule/podman/prepare.yml View File

@@ -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

+ 4
- 1
tripleo_ansible/roles/tripleo_create_admin/molecule/addkey/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/tripleo_create_admin/molecule/default/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/tripleo_create_admin/molecule/keygen/molecule.yml View File

@@ -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


+ 1
- 1
tripleo_ansible/roles/tripleo_hieradata/molecule/ansible_hieradata/molecule.yml View File

@@ -1,6 +1,6 @@
---
driver:
name: docker
name: podman

log: true



+ 4
- 1
tripleo_ansible/roles/tripleo_hieradata/molecule/default/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/tripleo_hieradata/molecule/hieradata_vars/molecule.yml View File

@@ -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


+ 4
- 1
tripleo_ansible/roles/tripleo_hosts_entries/molecule/default/molecule.yml View File

@@ -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


+ 8
- 14