From eb05c8bc1426f5fcc50d03b41ebec552e6db358d Mon Sep 17 00:00:00 2001 From: Arvind Patel Date: Thu, 21 May 2020 12:27:30 +0530 Subject: [PATCH] Removed end_play condition Change-Id: I79702e57de4a4d56fb1bbd7edf154dfe9b1bc1cc --- ocd/infra/playbooks/roles/docker/tasks/install.yml | 5 +---- ocd/infra/playbooks/roles/docker/tasks/uninstall.yml | 5 +---- ocd/infra/playbooks/roles/grafana/tasks/install.yml | 5 +---- ocd/infra/playbooks/roles/grafana/tasks/uninstall.yml | 5 +---- ocd/infra/playbooks/roles/helm/tasks/install.yml | 5 +---- ocd/infra/playbooks/roles/helm/tasks/uninstall.yml | 5 +---- ocd/infra/playbooks/roles/k3s/tasks/install.yml | 5 +---- ocd/infra/playbooks/roles/k3s/tasks/uninstall.yml | 5 +---- ocd/infra/playbooks/roles/k8s/tasks/install.yml | 5 +---- ocd/infra/playbooks/roles/prometheus/tasks/install.yml | 5 +---- ocd/infra/playbooks/roles/prometheus/tasks/uninstall.yml | 5 +---- ocd/infra/playbooks/roles/rabbitmq/tasks/install.yml | 5 +---- ocd/infra/playbooks/roles/rabbitmq/tasks/uninstall.yml | 5 +---- 13 files changed, 13 insertions(+), 52 deletions(-) diff --git a/ocd/infra/playbooks/roles/docker/tasks/install.yml b/ocd/infra/playbooks/roles/docker/tasks/install.yml index caded2e..f474369 100644 --- a/ocd/infra/playbooks/roles/docker/tasks/install.yml +++ b/ocd/infra/playbooks/roles/docker/tasks/install.yml @@ -16,16 +16,13 @@ - name: Check whether docker is already installed command: which docker register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: Docker is already present when: result.rc == 0 -- meta: end_play - when: result.rc == 0 - - name: "Installing docker update" command: apt-get update -y ignore_errors: yes diff --git a/ocd/infra/playbooks/roles/docker/tasks/uninstall.yml b/ocd/infra/playbooks/roles/docker/tasks/uninstall.yml index 5a01922..a28fcdb 100644 --- a/ocd/infra/playbooks/roles/docker/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/docker/tasks/uninstall.yml @@ -16,16 +16,13 @@ - name: Check whether docker is installed before deleting command: docker version register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: Docker is not present when: result.rc == 2 -- meta: end_play - when: result.rc == 2 - - name: "Uninstall docker engine" command: apt-get purge -y docker-engine ignore_errors: yes diff --git a/ocd/infra/playbooks/roles/grafana/tasks/install.yml b/ocd/infra/playbooks/roles/grafana/tasks/install.yml index 7efd8a6..bdf2854 100644 --- a/ocd/infra/playbooks/roles/grafana/tasks/install.yml +++ b/ocd/infra/playbooks/roles/grafana/tasks/install.yml @@ -17,16 +17,13 @@ shell: cmd: helm status mec-grafana register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: Grafana is already present when: result.rc == 0 -- meta: end_play - when: result.rc == 0 - - name: Install grafana on x86_64 shell: cmd: helm install mec-grafana stable/grafana diff --git a/ocd/infra/playbooks/roles/grafana/tasks/uninstall.yml b/ocd/infra/playbooks/roles/grafana/tasks/uninstall.yml index d95f346..aaad4ea 100644 --- a/ocd/infra/playbooks/roles/grafana/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/grafana/tasks/uninstall.yml @@ -17,16 +17,13 @@ shell: cmd: helm status mec-grafana register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: grafana is not present when: result.rc == 2 -- meta: end_play - when: result.rc == 2 - - name: Uninstall grafana shell: cmd: helm uninstall mec-grafana diff --git a/ocd/infra/playbooks/roles/helm/tasks/install.yml b/ocd/infra/playbooks/roles/helm/tasks/install.yml index 38ac89a..e0f33d9 100644 --- a/ocd/infra/playbooks/roles/helm/tasks/install.yml +++ b/ocd/infra/playbooks/roles/helm/tasks/install.yml @@ -16,16 +16,13 @@ - name: check whether helm is already installed command: which helm register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: Helm is already present when: result.rc == 0 -- meta: end_play - when: result.rc == 0 - - name: "Helm download command on x86_64" command: wget https://get.helm.sh/helm-v3.0.2-linux-amd64.tar.gz when: result is failed and ansible_architecture == 'x86_64' diff --git a/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml b/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml index 3750518..09aa6b2 100644 --- a/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml @@ -16,16 +16,13 @@ - name: check whether helm is installed before deleting command: which helm register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: Helm is not present when: result.rc == 2 -- meta: end_play - when: result.rc == 2 - - name: Helm Uninstall on x86_64 command: rm -rf linux-amd64/helm when: result is succeeded and ansible_architecture == 'x86_64' diff --git a/ocd/infra/playbooks/roles/k3s/tasks/install.yml b/ocd/infra/playbooks/roles/k3s/tasks/install.yml index e7a133b..c9f09c9 100644 --- a/ocd/infra/playbooks/roles/k3s/tasks/install.yml +++ b/ocd/infra/playbooks/roles/k3s/tasks/install.yml @@ -17,16 +17,13 @@ shell: cmd: which k3s register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: k3s is already present when: result.rc == 0 -- meta: end_play - when: result.rc == 0 - - debug: var=ansible_host - name: Disabling firewall for successfull k3s installation on CentOs diff --git a/ocd/infra/playbooks/roles/k3s/tasks/uninstall.yml b/ocd/infra/playbooks/roles/k3s/tasks/uninstall.yml index e5f16cc..e2232d5 100644 --- a/ocd/infra/playbooks/roles/k3s/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/k3s/tasks/uninstall.yml @@ -17,16 +17,13 @@ shell: cmd: which k3s register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: k3s is not present when: result.rc == 2 -- meta: end_play - when: result.rc == 2 - - name: kill k3s shell: cmd: k3s-killall.sh diff --git a/ocd/infra/playbooks/roles/k8s/tasks/install.yml b/ocd/infra/playbooks/roles/k8s/tasks/install.yml index 62f1a84..2b32b6d 100644 --- a/ocd/infra/playbooks/roles/k8s/tasks/install.yml +++ b/ocd/infra/playbooks/roles/k8s/tasks/install.yml @@ -17,16 +17,13 @@ - name: Check whether k8s is already installed command: which k8s register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: k8s is already present when: result.rc == 0 -- meta: end_play - when: result.rc == 0 - - name: Install k8s shell: # yamllint disable rule:line-length diff --git a/ocd/infra/playbooks/roles/prometheus/tasks/install.yml b/ocd/infra/playbooks/roles/prometheus/tasks/install.yml index b5a2722..0c85ecf 100644 --- a/ocd/infra/playbooks/roles/prometheus/tasks/install.yml +++ b/ocd/infra/playbooks/roles/prometheus/tasks/install.yml @@ -17,16 +17,13 @@ shell: cmd: helm status mep-prometheus register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: Prpmetheus is already present when: result.rc == 0 -- meta: end_play - when: result.rc == 0 - - name: Install prometheus on x86_64 shell: cmd: helm install mep-prometheus stable/prometheus --version v9.3.1 diff --git a/ocd/infra/playbooks/roles/prometheus/tasks/uninstall.yml b/ocd/infra/playbooks/roles/prometheus/tasks/uninstall.yml index 40aca5c..d9a1f4e 100644 --- a/ocd/infra/playbooks/roles/prometheus/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/prometheus/tasks/uninstall.yml @@ -17,16 +17,13 @@ shell: cmd: helm status mep-prometheus register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: Prometheus is not present when: result.rc == 2 -- meta: end_play - when: result.rc == 2 - - name: Uninstall prometheus shell: cmd: helm uninstall mep-prometheus diff --git a/ocd/infra/playbooks/roles/rabbitmq/tasks/install.yml b/ocd/infra/playbooks/roles/rabbitmq/tasks/install.yml index 6960ddd..f3e433c 100644 --- a/ocd/infra/playbooks/roles/rabbitmq/tasks/install.yml +++ b/ocd/infra/playbooks/roles/rabbitmq/tasks/install.yml @@ -17,16 +17,13 @@ shell: cmd: kubectl get pods rabbitmq-0 register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: Rabbitmq is already present when: result.rc == 0 -- meta: end_play - when: result.rc == 0 - - name: copy common folder to host for rabbitmg installation copy: src: common diff --git a/ocd/infra/playbooks/roles/rabbitmq/tasks/uninstall.yml b/ocd/infra/playbooks/roles/rabbitmq/tasks/uninstall.yml index c32f55f..e404819 100644 --- a/ocd/infra/playbooks/roles/rabbitmq/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/rabbitmq/tasks/uninstall.yml @@ -17,16 +17,13 @@ shell: cmd: kubectl get pods rabbitmq-0 register: result - failed_when: false + ignore_errors: yes no_log: True - debug: msg: Rabbitmq is not present when: result.rc == 2 -- meta: end_play - when: result.rc == 2 - - name: Uninstalling rabbitmq shell: cmd: kubectl delete -f /tmp/rabbitmq/common -- 2.16.6