Change-Id: I6f9d179c74b63a917a423e538678a5110cc12a34
14 files changed:
- debug:
msg: Docker is already present
- debug:
msg: Docker is already present
+ 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
- name: "Installing docker update"
command: apt-get update -y
command: apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
# yamllint disable rule:line-length
ignore_errors: yes
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 -
- 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
- name: "CA-Certificates"
# yamllint disable rule:line-length
ignore_errors: yes
failed_when: false
no_log: True
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
- 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
- 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'
---
# tasks file for docker
---
# tasks file for docker
-- name: Helm install
- debug:
- msg: installing helm
-
- include: "install.yml"
when: operation == 'install'
- include: "install.yml"
when: operation == 'install'
---
- name: Check whether docker is installed before deleting
---
- name: Check whether docker is installed before deleting
- command: docker version
register: result
ignore_errors: yes
no_log: True
- debug:
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
- 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
- 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 == '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
- 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'
- 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
#when: result is succeeded
- 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:
- name: Install grafana on x86_64
shell:
- 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:
- name: Uninstall grafana
shell:
- 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
- name: "Helm download command on x86_64"
command: wget https://get.helm.sh/helm-v3.0.2-linux-amd64.tar.gz
- 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
- name: Helm Uninstall on x86_64
command: rm -rf linux-amd64/helm
- debug:
msg: k3s is already present
- debug:
msg: k3s is already present
+ 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
- debug: var=ansible_host
- 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 == ""
- debug:
msg: k8s is already present
- debug:
msg: k8s is already present
+ 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:
- name: Install k8s
shell:
- 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:
- name: Install prometheus on x86_64
shell:
- 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:
- name: Uninstall prometheus
shell:
- 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:
- name: copy common folder to host for rabbitmg installation
copy:
- 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:
- name: Uninstalling rabbitmq
shell: