From: Arvind Patel Date: Thu, 21 May 2020 16:29:13 +0000 (+0530) Subject: Logs added with msgs X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=6ce510fccce9b5481e88d10c3ffa73ed0284b517;p=ealt-edge.git Logs added with msgs Change-Id: I6f9d179c74b63a917a423e538678a5110cc12a34 --- diff --git a/ocd/infra/playbooks/roles/docker/tasks/install.yml b/ocd/infra/playbooks/roles/docker/tasks/install.yml index f474369..e411e16 100644 --- a/ocd/infra/playbooks/roles/docker/tasks/install.yml +++ b/ocd/infra/playbooks/roles/docker/tasks/install.yml @@ -21,7 +21,13 @@ - debug: msg: Docker is already present - when: result.rc == 0 + when: result.stdout != "" + +- debug: +# yamllint disable rule:line-length + msg: Ignore Uninstall Log , Docker not installed continue with Installation +# yamllint disable rule:line-length + when: result.stdout == "" - name: "Installing docker update" command: apt-get update -y @@ -34,9 +40,11 @@ command: apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common # yamllint disable rule:line-length ignore_errors: yes + when: result is failed and ansible_architecture == 'aarch64' - name: Add repository shell: curl -sL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + when: result is failed and ansible_architecture == 'aarch64' - name: "CA-Certificates" # yamllint disable rule:line-length @@ -45,13 +53,16 @@ ignore_errors: yes failed_when: false no_log: True + when: result is failed and ansible_architecture == 'aarch64' - name: "Update....." command: apt-get update -y ignore_errors: yes failed_when: false no_log: True + when: result is failed and ansible_architecture == 'aarch64' - name: "Installed docker" command: apt-get install -y docker-ce docker-ce-cli containerd.io ignore_errors: yes + when: result is failed and ansible_architecture == 'aarch64' diff --git a/ocd/infra/playbooks/roles/docker/tasks/main.yml b/ocd/infra/playbooks/roles/docker/tasks/main.yml index 39f13a2..4c99ef0 100644 --- a/ocd/infra/playbooks/roles/docker/tasks/main.yml +++ b/ocd/infra/playbooks/roles/docker/tasks/main.yml @@ -14,10 +14,6 @@ --- # tasks file for docker -- name: Helm install - debug: - msg: installing helm - - include: "install.yml" when: operation == 'install' diff --git a/ocd/infra/playbooks/roles/docker/tasks/uninstall.yml b/ocd/infra/playbooks/roles/docker/tasks/uninstall.yml index a28fcdb..d011d18 100644 --- a/ocd/infra/playbooks/roles/docker/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/docker/tasks/uninstall.yml @@ -14,35 +14,45 @@ --- - name: Check whether docker is installed before deleting - command: docker version + command: which docker register: result ignore_errors: yes no_log: True - debug: - msg: Docker is not present - when: result.rc == 2 + msg: Uninstalling docker... + when: result.stdout != "" + +- debug: +# yamllint disable rule:line-length + msg: Ignore Uninstall Log , Docker not installed +# yamllint disable rule:line-length + when: result.stdout == "" - name: "Uninstall docker engine" command: apt-get purge -y docker-engine ignore_errors: yes + when: result is succeeded and ansible_architecture == 'aarch64' - name: "Uninstall docker" command: apt-get purge -y docker ignore_errors: yes + when: result is succeeded and ansible_architecture == 'aarch64' #when: result is succeeded and ansible_architecture == 'x86_64' - name: "Uninstall docker.io" command: apt-get purge -y docker.io ignore_errors: yes - #when: result is succeeded and ansible_architecture == 'aarch64' + when: result is succeeded and ansible_architecture == 'aarch64' - name: "Uninstall docker-ce" command: apt-get purge -y docker-ce ignore_errors: yes + when: result is succeeded and ansible_architecture == 'aarch64' #when: result is succeeded and ansible_architecture == 'aarch64' - name: "Uninstall docker" command: apt-get purge -y docker-ce-cli ignore_errors: yes + when: result is succeeded and ansible_architecture == 'aarch64' #when: result is succeeded diff --git a/ocd/infra/playbooks/roles/grafana/tasks/install.yml b/ocd/infra/playbooks/roles/grafana/tasks/install.yml index bdf2854..e55bda8 100644 --- a/ocd/infra/playbooks/roles/grafana/tasks/install.yml +++ b/ocd/infra/playbooks/roles/grafana/tasks/install.yml @@ -21,8 +21,14 @@ no_log: True - debug: - msg: Grafana is already present - when: result.rc == 0 + msg: grafana is already present + when: result.stdout != "" + +- debug: +# yamllint disable rule:line-length + msg: Ignore Uninstall Log , Grafana not installed continue with Installation +# yamllint disable rule:line-length + when: result.stdout == "" - name: Install grafana on x86_64 shell: diff --git a/ocd/infra/playbooks/roles/grafana/tasks/uninstall.yml b/ocd/infra/playbooks/roles/grafana/tasks/uninstall.yml index aaad4ea..6f08c57 100644 --- a/ocd/infra/playbooks/roles/grafana/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/grafana/tasks/uninstall.yml @@ -21,8 +21,12 @@ no_log: True - debug: - msg: grafana is not present - when: result.rc == 2 + msg: Uninstalling docker... + when: result.stdout != "" + +- debug: + msg: Ignore Uninstall Log , Grafana not installed + when: result.stdout == "" - name: Uninstall grafana shell: diff --git a/ocd/infra/playbooks/roles/helm/tasks/install.yml b/ocd/infra/playbooks/roles/helm/tasks/install.yml index e0f33d9..5dc8a0c 100644 --- a/ocd/infra/playbooks/roles/helm/tasks/install.yml +++ b/ocd/infra/playbooks/roles/helm/tasks/install.yml @@ -20,8 +20,14 @@ no_log: True - debug: - msg: Helm is already present - when: result.rc == 0 + msg: helm is already present + when: result.stdout != "" + +- debug: +# yamllint disable rule:line-length + msg: Ignore Uninstall Log , Helm not installed continue with Installation +# yamllint disable rule:line-length + when: result.stdout == "" - name: "Helm download command on x86_64" command: wget https://get.helm.sh/helm-v3.0.2-linux-amd64.tar.gz diff --git a/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml b/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml index 09aa6b2..1b18e36 100644 --- a/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml @@ -20,8 +20,12 @@ no_log: True - debug: - msg: Helm is not present - when: result.rc == 2 + msg: Uninstalling helm... + when: result.stdout != "" + +- debug: + msg: Ignore Uninstall Log ,Helm not installed + when: result.stdout == "" - name: Helm Uninstall on x86_64 command: rm -rf linux-amd64/helm diff --git a/ocd/infra/playbooks/roles/k3s/tasks/install.yml b/ocd/infra/playbooks/roles/k3s/tasks/install.yml index c9f09c9..0aaa7bd 100644 --- a/ocd/infra/playbooks/roles/k3s/tasks/install.yml +++ b/ocd/infra/playbooks/roles/k3s/tasks/install.yml @@ -22,7 +22,13 @@ - debug: msg: k3s is already present - when: result.rc == 0 + when: result.stdout != "" + +- debug: +# yamllint disable rule:line-length + msg: Ignore Uninstall Log , k3s not installed continue with Installation +# yamllint disable rule:line-length + when: result.stdout == "" - debug: var=ansible_host diff --git a/ocd/infra/playbooks/roles/k3s/tasks/uninstall.yml b/ocd/infra/playbooks/roles/k3s/tasks/uninstall.yml index e2232d5..bbf013c 100644 --- a/ocd/infra/playbooks/roles/k3s/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/k3s/tasks/uninstall.yml @@ -21,8 +21,12 @@ no_log: True - debug: - msg: k3s is not present - when: result.rc == 2 + msg: Uninstalling k3s... + when: result.stdout != "" + +- debug: + msg: Ignore Uninstall Log , K3s not installed + when: result.stdout == "" - name: kill k3s shell: diff --git a/ocd/infra/playbooks/roles/k8s/tasks/install.yml b/ocd/infra/playbooks/roles/k8s/tasks/install.yml index 2b32b6d..cd55ebf 100644 --- a/ocd/infra/playbooks/roles/k8s/tasks/install.yml +++ b/ocd/infra/playbooks/roles/k8s/tasks/install.yml @@ -22,7 +22,13 @@ - debug: msg: k8s is already present - when: result.rc == 0 + when: result.stdout != "" + +- debug: +# yamllint disable rule:line-length + msg: Ignore Uninstall Log , k8s not installed continue with Installation +# yamllint disable rule:line-length + when: result.stdout == "" - name: Install k8s shell: diff --git a/ocd/infra/playbooks/roles/prometheus/tasks/install.yml b/ocd/infra/playbooks/roles/prometheus/tasks/install.yml index 0c85ecf..be458fd 100644 --- a/ocd/infra/playbooks/roles/prometheus/tasks/install.yml +++ b/ocd/infra/playbooks/roles/prometheus/tasks/install.yml @@ -21,8 +21,14 @@ no_log: True - debug: - msg: Prpmetheus is already present - when: result.rc == 0 + msg: prometheus is already present + when: result.stdout != "" + +- debug: +# yamllint disable rule:line-length + msg: Ignore Uninstall Log , prometheus not installed continue with Installation +# yamllint disable rule:line-length + when: result.stdout == "" - name: Install prometheus on x86_64 shell: diff --git a/ocd/infra/playbooks/roles/prometheus/tasks/uninstall.yml b/ocd/infra/playbooks/roles/prometheus/tasks/uninstall.yml index d9a1f4e..c6436c5 100644 --- a/ocd/infra/playbooks/roles/prometheus/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/prometheus/tasks/uninstall.yml @@ -21,8 +21,12 @@ no_log: True - debug: - msg: Prometheus is not present - when: result.rc == 2 + msg: Uninstalling prometheus... + when: result.stdout != "" + +- debug: + msg: Ignore Uninstall Log , Prometheus not installed + when: result.stdout == "" - name: Uninstall prometheus shell: diff --git a/ocd/infra/playbooks/roles/rabbitmq/tasks/install.yml b/ocd/infra/playbooks/roles/rabbitmq/tasks/install.yml index f3e433c..d6fe987 100644 --- a/ocd/infra/playbooks/roles/rabbitmq/tasks/install.yml +++ b/ocd/infra/playbooks/roles/rabbitmq/tasks/install.yml @@ -21,8 +21,14 @@ no_log: True - debug: - msg: Rabbitmq is already present - when: result.rc == 0 + msg: rabbitmq is already present + when: result.stdout != "" + +- debug: +# yamllint disable rule:line-length + msg: Ignore Uninstall Log , rabbitmq not installed continue with Installation +# yamllint disable rule:line-length + when: result.stdout == "" - name: copy common folder to host for rabbitmg installation copy: diff --git a/ocd/infra/playbooks/roles/rabbitmq/tasks/uninstall.yml b/ocd/infra/playbooks/roles/rabbitmq/tasks/uninstall.yml index e404819..14c1276 100644 --- a/ocd/infra/playbooks/roles/rabbitmq/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/rabbitmq/tasks/uninstall.yml @@ -21,8 +21,12 @@ no_log: True - debug: - msg: Rabbitmq is not present - when: result.rc == 2 + msg: Uninstalling rabbitmq... + when: result.stdout != "" + +- debug: + msg: Ignore Uninstall Log , Rabbitmq not installed + when: result.stdout == "" - name: Uninstalling rabbitmq shell: