2017-10-19 16:17:11 +08:00
|
|
|
---
|
|
|
|
- name: Register docker images info
|
|
|
|
raw: >-
|
|
|
|
{{ 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 18:01:35 +08:00
|
|
|
when: download_container
|
2017-10-19 16:17:11 +08:00
|
|
|
|
|
|
|
- name: container_download | Create dest directory for saved/loaded container images
|
|
|
|
file:
|
|
|
|
path: "{{local_release_dir}}/containers"
|
|
|
|
state: directory
|
|
|
|
recurse: yes
|
|
|
|
mode: 0755
|
|
|
|
owner: "{{ansible_ssh_user|default(ansible_user_id)}}"
|
2018-08-04 18:01:35 +08:00
|
|
|
when: download_container
|
2017-10-19 16:17:11 +08:00
|
|
|
|
|
|
|
- name: container_download | create local directory for saved/loaded container images
|
|
|
|
file:
|
|
|
|
path: "{{local_release_dir}}/containers"
|
|
|
|
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 18:01:35 +08:00
|
|
|
- download_container
|
2017-10-19 16:17:11 +08:00
|
|
|
tags:
|
|
|
|
- localhost
|