Filter lxc_images list per host
To greatly reduce the amount of log noise from skipped tasks, when setting the 'lxc_images' var filter it to only include items that begin with the 'cache_index_item' var. The when clauses in tasks that looped through 'lxc_images' looking for this same match can be removed. Change-Id: I4bf7b32faa9ed0a8cddeb0792f912c0100dbece8
This commit is contained in:
parent
c6dda21cbc
commit
79eb16e44d
@ -40,8 +40,6 @@
|
||||
url: "{{ lxc_image_cache_server }}/{{ item.split(';')[-1] }}/meta.tar.xz"
|
||||
dest: "/tmp/meta.tar.xz"
|
||||
with_items: "{{ lxc_images }}"
|
||||
when:
|
||||
- item | match("^{{ cache_index_item }}")
|
||||
|
||||
- name: Place container metadata
|
||||
unarchive:
|
||||
|
@ -26,7 +26,14 @@
|
||||
|
||||
- name: Set image index fact
|
||||
set_fact:
|
||||
lxc_images: "{{ image_index.content.splitlines() }}"
|
||||
lxc_images: >
|
||||
{%- set images = [] %}
|
||||
{%- for image in image_index.content.splitlines() %}
|
||||
{%- if image | match("^" + cache_index_item) %}
|
||||
{%- set _ = images.append(image) %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{{- images -}}
|
||||
|
||||
- include: "lxc_cache_preparation_systemd_{{ (systemd_version.stdout_lines[0].split()[-1] | int > 219) | ternary('new', 'old') }}.yml"
|
||||
|
||||
|
@ -39,5 +39,3 @@
|
||||
- pull_image.rc != 0
|
||||
- "'failed' in pull_image.stderr | lower"
|
||||
with_items: "{{ lxc_images }}"
|
||||
when:
|
||||
- item | match("^{{ cache_index_item }}")
|
||||
|
@ -126,8 +126,6 @@
|
||||
retries: 3
|
||||
delay: 1
|
||||
with_items: "{{ lxc_images }}"
|
||||
when:
|
||||
- item | match("^{{ cache_index_item }}")
|
||||
|
||||
- name: Place container rootfs
|
||||
unarchive:
|
||||
|
Loading…
Reference in New Issue
Block a user