Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

dprr: modify list of "popular" images for CentOS based streams #418

Merged
merged 1 commit into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions roles/docker_pull_run_remove/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,31 @@
#
# popular_images is defined in roles/docker_pull_run_remove/vars/main.yml
#
- when: "'CentOS' in ansible_distribution"
set_fact:
dprr_images: "{{ centos_popular_images }}"

- when: "'CentOS' not in ansible_distribution"
set_fact:
dprr_images: "{{ popular_images }}"

- name: Pull the popular container images
command: "docker pull {{ item }}"
with_items: "{{ popular_images }}"
with_items: "{{ dprr_images }}"
register: dpd
retries: 5
delay: 60
until: dpd|success

- name: Run the popular container images
command: "docker run --rm {{ item }} echo 'hello'"
with_items: "{{ popular_images }}"
with_items: "{{ dprr_images }}"

# Test for https://bugzilla.redhat.com/show_bug.cgi?id=1585735
- name: Run the popular container images with cpu-shares flag
command: "docker run --cpu-shares 2 --rm {{ item }} echo 'hello'"
with_items: "{{ popular_images }}"
with_items: "{{ dprr_images }}"

- name: Remove the popular container images
command: "docker rmi {{ item }}"
with_items: "{{ popular_images }}"
with_items: "{{ dprr_images }}"
10 changes: 10 additions & 0 deletions roles/docker_pull_run_remove/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@ popular_images:
- registry.fedoraproject.org/fedora
- registry.centos.org/centos/centos
- registry.access.redhat.com/rhel

# Until https://github.com/CentOS/sig-atomic-buildscripts/issues/329
# is resolved, we will use a different list of images for CentOS AH
# streams
centos_popular_images:
- docker.io/alpine
- docker.io/busybox
- docker.io/ubuntu
- registry.fedoraproject.org/fedora
- registry.centos.org/centos/centos