2017-10-19 08:17:11 +00:00
|
|
|
---
|
|
|
|
- name: Register docker images info
|
2018-11-06 19:07:11 +00:00
|
|
|
shell: >-
|
2017-10-19 08:17:11 +00:00
|
|
|
{{ docker_bin_dir }}/docker images -q | xargs {{ docker_bin_dir }}/docker inspect -f "{{ '{{' }} (index .RepoTags 0) {{ '}}' }},{{ '{{' }} (index .RepoDigests 0) {{ '}}' }}" | tr '\n' ','
|
|
|
|
no_log: true
|
|
|
|
register: docker_images
|
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
|
|
|
check_mode: no
|
2018-08-04 10:01:35 +00:00
|
|
|
when: download_container
|
2017-10-19 08:17:11 +00:00
|
|
|
|
|
|
|
- name: container_download | Create dest directory for saved/loaded container images
|
|
|
|
file:
|
2019-05-02 21:24:21 +00:00
|
|
|
path: "{{ local_release_dir }}/containers"
|
2017-10-19 08:17:11 +00:00
|
|
|
state: directory
|
|
|
|
recurse: yes
|
|
|
|
mode: 0755
|
2019-05-02 21:24:21 +00:00
|
|
|
owner: "{{ ansible_ssh_user|default(ansible_user_id) }}"
|
2018-08-04 10:01:35 +00:00
|
|
|
when: download_container
|
2017-10-19 08:17:11 +00:00
|
|
|
|
|
|
|
- name: container_download | create local directory for saved/loaded container images
|
|
|
|
file:
|
2019-05-02 21:24:21 +00:00
|
|
|
path: "{{ local_release_dir }}/containers"
|
2017-10-19 08:17:11 +00:00
|
|
|
state: directory
|
|
|
|
recurse: yes
|
|
|
|
delegate_to: localhost
|
|
|
|
delegate_facts: false
|
|
|
|
become: false
|
|
|
|
run_once: true
|
|
|
|
when:
|
|
|
|
- download_run_once
|
|
|
|
- download_delegate == 'localhost'
|
2018-08-04 10:01:35 +00:00
|
|
|
- download_container
|
2017-10-19 08:17:11 +00:00
|
|
|
tags:
|
|
|
|
- localhost
|