shell:
cmd: helm status cadvisor
register: result
- ignore_errors: 'True'
+ failed_when: false
+ no_log: True
-- name: "This is for Add repo helm "
+- debug:
+ msg: cAdvisor is already present
+ when: result.rc == 0
+
+- meta: end_play
+ when: result.rc == 0
+
+- name: "Add helm repo"
command: helm repo add code-chris https://code-chris.github.io/helm-charts
when: result is failed
-- name: "This is for Update helm repo"
+- name: "Update helm repo"
command: helm repo update
when: result is failed
dest: /tmp/cAdvisor/
when: result is failed
-- name: "Command for install cAdvisor"
+- name: "Installing cAdvisor"
# yamllint disable rule:line-length
command: helm install cadvisor code-chris/cadvisor -f /tmp/cAdvisor/values.yaml
# yamllint disable rule:line-length