AIO and MUNO mode upgrade for EG 1.5.0 version
[eliot.git] / blueprints / iotgateway / 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 ---
16 ### MUNO edge installation ###
17
18 - name: Check edgegallery tar ball present
19   stat:
20     path: /tmp/eg_download/deploy/EdgeGallery-v1.5.0-edge-x86.tar.gz
21   register: edge_tar_var
22
23 - name: Creates directory
24   file:
25     path: /tmp/eg_download/deploy/
26     state: directory
27
28 - name: Download 1.5.0 edgegallery x86 edge
29 # yamllint disable rule:line-length
30   command: wget http://edgegallery-v1.5.0.obs.cn-north-4.myhuaweicloud.com/x86/EdgeGallery-v1.5.0-edge-x86.tar.gz
31 # yamllint disable rule:line-length
32   args:
33     chdir: /tmp/eg_download/deploy/
34   when: not edge_tar_var.stat.exists
35
36 - name: Untar Edgegallery offline edge tar file
37   command: tar -xvf EdgeGallery-v1.5.0-edge-x86.tar.gz
38   args:
39     chdir: /tmp/eg_download/deploy/
40   when: not edge_tar_var.stat.exists
41
42 - name: Set inventory file for muno edge
43 # yamllint disable rule:line-length
44   command: scp root@{{ OCD_IP }}:"{{playbook_dir}}"/muno-config/edge/hosts-muno-edge .
45 # yamllint disable rule:line-length
46   args:
47     chdir: /tmp/eg_download/deploy/EdgeGallery-v1.5.0-edge-x86/install
48
49 - name: Set var.yml file for muno edge
50 # yamllint disable rule:line-length
51   command: scp root@{{ OCD_IP }}:"{{playbook_dir}}"/muno-config/edge/var.yml .
52 # yamllint disable rule:line-length
53   args:
54     chdir: /tmp/eg_download/deploy/EdgeGallery-v1.5.0-edge-x86/install
55
56 - name: Set password-var.yml file for muno edge
57 # yamllint disable rule:line-length
58   command: scp root@{{ OCD_IP }}:"{{playbook_dir}}"/password-var.yml .
59 # yamllint disable rule:line-length
60   args:
61     chdir: /tmp/eg_download/deploy/EdgeGallery-v1.5.0-edge-x86/install
62
63
64 - name: Install edgegallery edge
65   shell:
66     # yamllint disable rule:line-length
67     cmd: ansible-playbook --inventory hosts-muno-edge -e "ansible_user=root" eg_edge_aio_install.yml >> muno_edge_log
68     # yamllint disable rule:line-length
69     chdir: /tmp/eg_download/deploy/EdgeGallery-v1.5.0-edge-x86/install
70   when: ansible_architecture == 'x86_64'