2 # Copyright 2020 Huawei Technologies Co., Ltd.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 - name: Doing deployment setup for edge gallery
22 dest: /tmp/eg_registry/
25 - name: Import config file
27 file: ../../../config.yml
30 - name: Make dir for arm images
31 command: mkdir -p /tmp/eg_registry/armtarball
35 - name: Set a variable
36 ansible.builtin.set_fact:
37 processor: "{{ vardata.master_edge_processor.name}}"
39 - name: Downloading based on master_edge_processor value x86_64 tarball
40 command: wget http://release.edgegallery.org/x86/all/0.9.tar.gz
42 chdir: /tmp/eg_registry/deploy/
43 when: processor == "x86_64"
45 - name: Download 0.9 tar arms based on master_edge_processor value
46 command: wget http://release.edgegallery.org/arm64/all/0.9.tar.gz
48 chdir: /tmp/eg_registry/armtarball/
49 when: ansible_architecture == 'aarch64' and processor == "x86_64"
51 - name: Download 0.9 tar arms
52 command: wget http://release.edgegallery.org/arm64/all/0.9.tar.gz
54 chdir: /tmp/eg_registry/deploy/
55 when: ansible_architecture == 'aarch64' and processor != "x86_64"
57 - name: Download 0.9 tar x86
58 command: wget http://release.edgegallery.org/x86/all/0.9.tar.gz
60 chdir: /tmp/eg_registry/deploy/
61 when: ansible_architecture == 'x86_64'
63 - name: Untar the donwloaded tar
64 command: tar -zxf 0.9.tar.gz
66 chdir: /tmp/eg_registry/deploy/
68 - name: Untar the donwloaded tar
69 command: tar -zxf 0.9.tar.gz
71 chdir: /tmp/eg_registry/armtarball/
72 when: processor == "x86_64"
74 - name: Registry replaced for cross playform
75 command: rm -rf /tmp/eg_registry/deploy/registry
76 when: processor == "x86_64"
78 - name: Docker image replaced for cross playform
79 command: rm -rf /tmp/eg_registry/deploy/eg_swr_images/nginx#stable.tar.gz
80 when: processor == "x86_64"
82 - name: Docker image replaced for cross playform tool chain
83 # yamllint disable rule:line-length
84 command: rm -rf /tmp/eg_registry/deploy/eg_swr_images/edgegallery@deploy-tool#latest.tar.gz
85 # yamllint disable rule:line-length
86 when: processor == "x86_64"
88 - name: Copy registry from x86 tarball
89 command: cp -r /tmp/eg_registry/armtarball/registry /tmp/eg_registry/deploy/
90 when: processor == "x86_64"
92 - name: Copy docker image from x86 tarball
93 # yamllint disable rule:line-length
94 command: cp -r /tmp/eg_registry/armtarball/eg_swr_images/nginx#stable.tar.gz /tmp/eg_registry/deploy/eg_swr_images/
95 # yamllint disable rule:line-length
96 when: processor == "x86_64"
98 - name: Copy docker image from x86 tarball tool chain
99 # yamllint disable rule:line-length
100 command: cp -r /tmp/eg_registry/armtarball/eg_swr_images/edgegallery@deploy-tool#latest.tar.gz /tmp/eg_registry/deploy/eg_swr_images/
101 # yamllint disable rule:line-length
102 when: processor == "x86_64"
104 - name: Replacing private ip
106 path: /tmp/eg_registry/deploy/load-images.sh
107 regexp: 'REGISTRIES_IP'
108 replace: "{{ vardata.private_repo_ip.name }}"
110 - name: Replacing private port
112 path: /tmp/eg_registry/deploy/load-images.sh
113 regexp: 'REGISTRIES_PORT'
114 replace: "{{ vardata.docker_registry_port.name }}"
116 - name: Execute the script
118 cmd: /tmp/eg_registry/deploy/load-images.sh