Only pull images for destined host groups (#4735)
Without this, pulls are considered for all hosts groups, even if not targetted by the downloads `groups` list. Hence, a download/sync is triggered even though the host does not require the image.
This commit is contained in:
parent
3f62492a15
commit
13f225e6ae
1 changed files with 7 additions and 2 deletions
|
@ -15,12 +15,16 @@
|
||||||
failed_when: false
|
failed_when: false
|
||||||
changed_when: false
|
changed_when: false
|
||||||
check_mode: no
|
check_mode: no
|
||||||
when: not download_always_pull
|
when:
|
||||||
|
- not download_always_pull
|
||||||
|
- group_names | intersect(download.groups) | length
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
pull_required: >-
|
pull_required: >-
|
||||||
{%- if pull_args in docker_images.stdout.split(',') %}false{%- else -%}true{%- endif -%}
|
{%- if pull_args in docker_images.stdout.split(',') %}false{%- else -%}true{%- endif -%}
|
||||||
when: not download_always_pull
|
when:
|
||||||
|
- not download_always_pull
|
||||||
|
- group_names | intersect(download.groups) | length
|
||||||
|
|
||||||
- name: Does any host require container pull?
|
- name: Does any host require container pull?
|
||||||
vars:
|
vars:
|
||||||
|
@ -35,6 +39,7 @@
|
||||||
assert:
|
assert:
|
||||||
that: "{{ download.repo }}:{{ download.tag }} in docker_images.stdout.split(',')"
|
that: "{{ download.repo }}:{{ download.tag }} in docker_images.stdout.split(',')"
|
||||||
when:
|
when:
|
||||||
|
- group_names | intersect(download.groups) | length
|
||||||
- not download_always_pull
|
- not download_always_pull
|
||||||
- not pull_required
|
- not pull_required
|
||||||
- pull_by_digest
|
- pull_by_digest
|
||||||
|
|
Loading…
Reference in a new issue