2016-03-24 21:21:07 +08:00
|
|
|
---
|
|
|
|
# Normal case - pull image from registry
|
2017-02-09 22:16:39 +08:00
|
|
|
- name: "pull {{ ceph_docker_image }} image"
|
|
|
|
command: "docker pull {{ ceph_docker_registry}}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
2016-03-24 21:21:07 +08:00
|
|
|
changed_when: false
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- (ceph_docker_dev_image is undefined or not ceph_docker_dev_image)
|
2016-03-24 21:21:07 +08:00
|
|
|
|
|
|
|
# Dev case - export local dev image and send it across
|
|
|
|
- name: export local ceph dev image
|
2016-07-09 09:38:13 +08:00
|
|
|
local_action: command docker save -o "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar" "{{ ceph_docker_username }}/{{ ceph_docker_imagename }}:{{ ceph_docker_image_tag }}"
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- (ceph_docker_dev_image is defined and ceph_docker_dev_image)
|
2016-03-24 21:21:07 +08:00
|
|
|
run_once: true
|
|
|
|
|
|
|
|
- name: copy ceph dev image file
|
|
|
|
copy:
|
2016-07-09 09:38:13 +08:00
|
|
|
src: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
|
|
|
|
dest: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- (ceph_docker_dev_image is defined and ceph_docker_dev_image)
|
2016-03-24 21:21:07 +08:00
|
|
|
|
|
|
|
- name: load ceph dev image
|
2016-07-09 09:38:13 +08:00
|
|
|
command: "docker load -i /tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- (ceph_docker_dev_image is defined and ceph_docker_dev_image)
|
2016-03-24 21:21:07 +08:00
|
|
|
|
|
|
|
- name: remove tmp ceph dev image file
|
2016-07-09 09:38:13 +08:00
|
|
|
command: "rm /tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- (ceph_docker_dev_image is defined and ceph_docker_dev_image)
|