Skip to content

Commit

Permalink
roles: use alternate set of images for CentOS
Browse files Browse the repository at this point in the history
CentOS AH is missing the Red Hat CA cert, so it is unable to pull
images from the registry (see:  CentOS/sig-atomic-buildscripts#329).
To workaround this, we'll have to build the list of images to pull
differently for CentOS vs. the rest.
  • Loading branch information
miabbott committed Oct 11, 2018
1 parent a1fbd00 commit 0771e51
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 13 additions & 5 deletions roles/podman_pull_run_remove/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,30 +33,30 @@

- 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
until: podman_pull is success

- 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:
Expand Down
2 changes: 2 additions & 0 deletions roles/podman_pull_run_remove/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 0771e51

Please sign in to comment.