Changed install and uninstall condition
[ealt-edge.git] / ocd / infra / playbooks / roles / rabbitmq / tasks / install.yml
index 6960ddd..5edeed7 100644 (file)
   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
+    msg: rabbitmq is already present
+  when: result.stdout != ""
 
-- meta: end_play
-  when: result.rc == 0
+- 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
+- name: "INSTALL: copy common folder to host for rabbitmg installation"
   copy:
     src: common
     dest: /tmp/rabbitmq/
   when: result is failed
 
-- name: Install common for rabbitmg installation
+- name: "INSTALL: Install common for rabbitmg installation"
   shell:
     cmd: kubectl apply -f /tmp/rabbitmq/common
   when: result is failed
 
-- name: copy statefulset_x86.yaml to host for rabbitmg installation
+- name: "INSTALL: copy statefulset_x86.yaml to host for rabbitmg installation"
   copy:
     src: statefulset_x86.yaml
     dest: /tmp/rabbitmq/
   when: result is failed and ansible_architecture == 'x86_64'
 
-- name: Install rabbitmq on x86_64
+- name: "INSTALL: Install rabbitmq on x86_64"
   shell:
     cmd: kubectl apply -f /tmp/rabbitmq/statefulset_x86.yaml
   when: result is failed and ansible_architecture == 'x86_64'
 
-- name: copy statefulset_arm.yaml to host for rabbitmg installation
+- name: "INSTALL: copy statefulset_arm.yaml to host for rabbitmg installation"
   copy:
     src: statefulset_arm.yaml
     dest: /tmp/rabbitmq/
   when: result is failed and ansible_architecture == 'aarch64'
 
-- name: Install rabbitmq on aarch64
+- name: "INSTALL: Install rabbitmq on aarch64"
   shell:
     cmd: kubectl apply -f /tmp/rabbitmq/statefulset_arm.yaml
   when: result is failed and ansible_architecture == 'aarch64'