blob: f19491fde8b87dbea47bbecc5cc3eda6fcf49ce9 [file] [log] [blame]
---
# ============LICENSE_START=======================================================
# Copyright (C) 2020 The Nordix Foundation. All rights reserved.
# ================================================================================
# 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.
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
- name: Create directory to store container images
file:
path: "{{ containers_folder }}"
state: "{{ item }}"
with_items:
- absent
- directory
# NOTE (eprasad): docker_image module doesn't seem to respect become so falling back to command module
- name: Pull test stack container images
command: "docker pull {{ xtesting_image_repo }}/{{ item.value.image_name }}@sha256:{{ item.value.image_version }}"
with_dict: "{{ framework[testfw] }}"
become: true
changed_when: false
- name: Add tag to the stack images
command: |-
docker tag "{{ xtesting_image_repo }}/{{ item.value.image_name }}@sha256:{{ item.value.image_version }}"
"onap/{{ item.value.image_name }}:{{ test_stack_version }}"
with_dict: "{{ framework[testfw] }}"
become: true
changed_when: false
# save container images
- name: Save test stack container images
command: |-
docker save "onap/{{ item.value.image_name }}:{{ test_stack_version }}"
-o {{ item.value.image_name | replace('/', '_') }}-{{ test_stack_version }}.tar
with_dict: "{{ framework[testfw] }}"
args:
chdir: "{{ containers_folder }}"
become: true
changed_when: false
# NOTE (eprasad): archive fails due to wrong permissions so we fix them
- name: Fix container image permissions
file:
path: "{{ containers_folder }}"
state: directory
recurse: true
mode: 0755
become: true
# vim: set ts=2 sw=2 expandtab: