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