From 93f1cd237853da0ed43b7e1226957fcc5cd3a1b3 Mon Sep 17 00:00:00 2001 From: Srinivasan Date: Thu, 17 Jun 2021 21:16:16 +0530 Subject: [PATCH] tar file check Signed-off-by: Srinivasan Change-Id: Id1cb0b1c3d6cee57fb33bb752a264fd8fe882211 --- .../roles/egallery-munomode-controller/tasks/install.yml | 11 ++++++++--- .../roles/egallery-munomode-edge/tasks/install.yml | 13 +++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/install.yml b/ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/install.yml index 3559511..add7807 100644 --- a/ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/install.yml +++ b/ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/install.yml @@ -23,19 +23,24 @@ chdir: "{{playbook_dir}}" ignore_errors: yes +- name: Check edgegallery tar ball present + stat: + path: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-controller-x86.tar.gz + register: tar_var + - name: Download 1.1 edgegallery x86 controller # yamllint disable rule:line-length command: wget https://edgegallery.obs.cn-east-3.myhuaweicloud.com/releases/v1.1.1/x86/EdgeGallery-v1.1.1-controller-x86.tar.gz # yamllint disable rule:line-length args: chdir: /tmp/eg_download/deploy/ - when: ansible_architecture == 'x86_64' + when: not tar_var.stat.exists - name: Untar Edgegallery offline controller tar file command: tar -xvf EdgeGallery-v1.1.1-controller-x86 args: chdir: /tmp/eg_download/deploy/ - when: ansible_architecture == 'x86_64' + when: not tar_var.stat.exists - name: Set inventory file for muno controller # yamllint disable rule:line-length @@ -49,7 +54,7 @@ command: cp muno-config/controller/var.yml /tmp/eg_download/deploy/EdgeGallery-v1.1.1-controller-x86/install # yamllint disable rule:line-length args: - chdir: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-edge-x86/install + chdir: "{{playbook_dir}}" - name: Install edgegallery controller shell: diff --git a/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/install.yml b/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/install.yml index 1edac16..fafeae9 100644 --- a/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/install.yml +++ b/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/install.yml @@ -15,33 +15,38 @@ --- ### MUNO edge installation ### +- name: Check edgegallery tar ball present + stat: + path: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-edge-x86.tar.gz + register: edge_tar_var + - name: Download 1.1 edgegallery x86 edge # yamllint disable rule:line-length command: wget https://edgegallery.obs.cn-east-3.myhuaweicloud.com/releases/v1.1.1/x86/EdgeGallery-v1.1.1-edge-x86.tar.gz # yamllint disable rule:line-length args: chdir: /tmp/eg_download/deploy/ - when: ansible_architecture == 'x86_64' + when: not edge_tar_var.stat.exists - name: Untar Edgegallery offline edge tar file command: tar -xvf EdgeGallery-v1.1.1-edge-x86 args: chdir: /tmp/eg_download/deploy/ - when: ansible_architecture == 'x86_64' + when: not edge_tar_var.stat.exists - name: Set inventory file for muno edge # yamllint disable rule:line-length command: scp root@{{ OCD_IP }}:"{{playbook_dir}}"/muno-config/edge/hosts-muno-edge . # yamllint disable rule:line-length args: - chdir: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-edge-x86/install + chdir: "{{playbook_dir}}" - name: Set var.yml file for muno edge # yamllint disable rule:line-length command: scp root@{{ OCD_IP }}:"{{playbook_dir}}"/muno-config/edge/var.yml . # yamllint disable rule:line-length args: - chdir: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-edge-x86/install + chdir: "{{playbook_dir}}" - name: Install edgegallery edge shell: -- 2.16.6