Skip to content

Commit

Permalink
fixed pull-retag0push playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
g0rgamesh committed Sep 9, 2022
1 parent 9956c2e commit a0fd78b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions etc/kayobe/ansible/pull-retag-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

- name: Build a list of images
vars:
image: "{{ kolla_base_distro }}-{{ image_name }}"
image: "{{ image_name }}"
image_name: "{{ item.1.split()[2] }}"
set_fact:
images: "{{ (images | default([])) + [image] }}"
Expand All @@ -80,24 +80,24 @@
- name: Pull container images (may take a long time)
become: true
vars:
remote_image: "{% if docker_pull_registry != '' %}{{ docker_pull_registry }}/{% endif %}{{ docker_pull_namespace }}/{{ item }}:{{ docker_pull_tag }}"
remote_image: "{% if docker_pull_registry != '' %}{{ docker_pull_registry }}/{% endif %}{{ docker_pull_namespace }}/{{ item }}:{{ docker_pull_tag }}-{{ kolla_base_distro }}-{{ ansible_facts.distribution_release }}"
command:
cmd: "docker pull {{ remote_image }}"
with_items: "{{ images }}"

- name: Retag container images
become: true
vars:
remote_image: "{% if docker_pull_registry != '' %}{{ docker_pull_registry }}/{% endif %}{{ docker_pull_namespace }}/{{ item }}:{{ docker_pull_tag }}"
local_image: "{{ kolla_docker_registry }}/{{ kolla_docker_namespace }}/{{ item }}:{{ kolla_tag }}"
remote_image: "{% if docker_pull_registry != '' %}{{ docker_pull_registry }}/{% endif %}{{ docker_pull_namespace }}/{{ item }}:{{ docker_pull_tag }}-{{ kolla_base_distro }}-{{ ansible_facts.distribution_release }}"
local_image: "{{ kolla_docker_registry }}/{{ kolla_docker_namespace }}/{{ item }}:{{ kolla_tag }}-{{ kolla_base_distro }}-{{ ansible_facts.distribution_release }}"
command:
cmd: "docker tag {{ remote_image }} {{ local_image }}"
with_items: "{{ images }}"

- name: Push container images (may take a long time)
become: true
vars:
local_image: "{{ kolla_docker_registry }}/{{ kolla_docker_namespace }}/{{ item }}:{{ kolla_tag }}"
local_image: "{{ kolla_docker_registry }}/{{ kolla_docker_namespace }}/{{ item }}:{{ kolla_tag }}-{{ kolla_base_distro }}-{{ ansible_facts.distribution_release }}"
command:
cmd: "docker push {{ local_image }}"
with_items: "{{ images }}"

0 comments on commit a0fd78b

Please sign in to comment.