blob: 14e185ae229723d75a210c79c4e3c8ed8f025b04 [file] [log] [blame]
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- hosts: {{ swarm_manager_address }}
become: true
tasks:
{% if not delete -%}
- name: make a directory for swarm archive image
file:
path: {{ image_dir }}
state: directory
mode: 0755
- name: copy docker image file(.tar) to swarm manager node
copy:
src: {{ image_file_path }}
dest: {{ image_file_path }}
- name: load a docker image from archive file(example-abc.tar)
shell: docker load -i {{ image_file_path }}
- name: change tag information
shell: docker tag {{ image_name }} {{ swarm_manager_address }}:{{ docker_registry_port }}/{{ image_name }}:{{ image_tag }}
- name: push docker image to local registry
docker_image:
name: {{ swarm_manager_address }}:{{ docker_registry_port }}/{{ image_name }}
tag: {{ image_tag }}
push: yes
- name: Inspect a image
docker_image_facts:
name: {{ swarm_manager_address }}:{{ docker_registry_port }}/{{ image_name }}:{{ image_tag }}
{% else -%}
# Don't delete a docker image
{% endif %}