diff --git a/roles/podman_pull_run_remove/tasks/main.yml b/roles/podman_pull_run_remove/tasks/main.yml index ec679d3..775b699 100644 --- a/roles/podman_pull_run_remove/tasks/main.yml +++ b/roles/podman_pull_run_remove/tasks/main.yml @@ -16,6 +16,14 @@ register: podman ignore_errors: true +- when: ansible_distribution != 'CentOS' + set_fact: + pull_images: "{{ popular_images | combine(rhel_images) }}" + +- when: ansible_distribution == 'CentOS' + set_fact: + pull_images: "{{ popular_images }}" + - when: podman.rc == 0 block: - name: Disable the docker daemon @@ -25,7 +33,7 @@ - name: Pull the popular container images command: "podman pull {{ item.key }}" - with_dict: "{{ popular_images }}" + with_dict: "{{ pull_images }}" register: podman_pull retries: 5 delay: 60 @@ -33,22 +41,22 @@ - name: Run the popular container images command: "podman run --rm {{ item.key }} echo 'hello'" - with_dict: "{{ popular_images }}" + with_dict: "{{ pull_images }}" # Test for https://bugzilla.redhat.com/show_bug.cgi?id=1585735 - name: Run the popular container images with cpu-shares flag command: "podman run --cpu-shares 2 --rm {{ item.key }} echo 'hello'" - with_dict: "{{ popular_images }}" + with_dict: "{{ pull_images }}" # Test for https://bugzilla.redhat.com/show_bug.cgi?id=1592932 # https://bugzilla.redhat.com/show_bug.cgi?id=1593419 - name: Run the popular container images testing for network access command: "podman run --rm {{ item.key }} {{ item.value }}" - with_dict: "{{ popular_images }}" + with_dict: "{{ pull_images }}" - name: Remove the popular container images command: "podman rmi {{ item.key }}" - with_dict: "{{ popular_images }}" + with_dict: "{{ pull_images }}" - name: Re-enable docker service: diff --git a/roles/podman_pull_run_remove/vars/main.yml b/roles/podman_pull_run_remove/vars/main.yml index 9370465..c88e44a 100644 --- a/roles/podman_pull_run_remove/vars/main.yml +++ b/roles/podman_pull_run_remove/vars/main.yml @@ -7,4 +7,6 @@ popular_images: docker.io/ubuntu: 'bash -c "apt-get update && apt-get -y install iputils-ping && ping -c 3 1.1.1.1"' registry.fedoraproject.org/fedora: 'bash -c "dnf -y install iputils && ping -c 3 1.1.1.1"' registry.centos.org/centos/centos: 'ping -c 3 1.1.1.1' + +rhel_images: registry.access.redhat.com/rhel: 'curl --fail -o /dev/null -I https://1.1.1.1'