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