MUNO mode update for EG1.5 version upgrade
[ealt-edge.git] / ocd / infra / playbooks / roles / egallery-munomode-edge / tasks / install.yml
1 # Copyright 2021 Huawei Technologies Co., Ltd.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 ### MUNO edge installation ###
16
17 - name: Creates directory
18   file:
19     path: /tmp/eg_download/deploy/
20     state: directory
21
22 - name: Check edgegallery tar ball present
23   stat:
24     path: /tmp/eg_download/deploy/EdgeGallery-v1.5.0-edge-x86.tar.gz
25   register: edge_tar_var
26
27 - name: Download 1.5.0 edgegallery x86 edge
28   # yamllint disable rule:line-length
29   command: wget http://edgegallery-v1.5.0.obs.cn-north-4.myhuaweicloud.com/x86/EdgeGallery-v1.5.0-edge-x86.tar.gz
30   # yamllint disable rule:line-length
31   args:
32     chdir: /tmp/eg_download/deploy/
33   when: not edge_tar_var.stat.exists
34
35 - name: Untar Edgegallery offline edge tar file
36   command: tar -xvf EdgeGallery-v1.5.0-edge-x86.tar.gz
37   args:
38      chdir: /tmp/eg_download/deploy/
39   when: not edge_tar_var.stat.exists
40
41 - name: Set inventory file for muno edge
42   # yamllint disable rule:line-length
43   command: scp root@{{ OCD_IP }}:"{{playbook_dir}}"/muno-config/edge/hosts-muno-edge .
44   # yamllint disable rule:line-length
45   args:
46     chdir: /tmp/eg_download/deploy/EdgeGallery-v1.5.0-edge-x86/install
47
48 - name: Set var.yml file for muno edge
49   # yamllint disable rule:line-length
50   command: scp root@{{ OCD_IP }}:"{{playbook_dir}}"/muno-config/edge/var.yml .
51   # yamllint disable rule:line-length
52   args:
53     chdir: /tmp/eg_download/deploy/EdgeGallery-v1.5.0-edge-x86/install
54
55 - name: Set password-var.yml file for muno edge
56   # yamllint disable rule:line-length
57   command: scp root@{{ OCD_IP }}:"{{playbook_dir}}"/password-var.yml .
58   # yamllint disable rule:line-length
59   args:
60     chdir: /tmp/eg_download/deploy/EdgeGallery-v1.5.0-edge-x86/install
61
62 - name: Install edgegallery edge
63   shell:
64     # yamllint disable rule:line-length
65     cmd: ansible-playbook --inventory hosts-muno-edge -e "ansible_user=root" eg_edge_aio_install.yml >> muno_edge_log
66     # yamllint disable rule:line-length
67     chdir: /tmp/eg_download/deploy/EdgeGallery-v1.5.0-edge-x86/install
68   when: ansible_architecture == 'x86_64'