purge-cluster: add podman support

The podman support was added to the purge-container-cluster playbook but
containers are always used for the dashboard even on non containerized
deployment.
This commits adds the podman support on purging the dashboard resources
in the purge-cluster playbook.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 89f6cc54a2)
pull/4823/head
Dimitri Savineau 2019-12-04 10:10:08 -05:00 committed by Dimitri Savineau
parent acf2476f09
commit 3b26df8c75
2 changed files with 19 additions and 37 deletions

View File

@ -134,10 +134,11 @@
become: true become: true
tasks: tasks:
- name: set ceph_docker_registry value if not set - import_role:
set_fact: name: ceph-defaults
ceph_docker_registry: "docker.io" - import_role:
when: ceph_docker_registry is not defined name: ceph-facts
tasks_from: container_binary
- name: disable node_exporter service - name: disable node_exporter service
service: service:
@ -146,25 +147,15 @@
enabled: no enabled: no
failed_when: false failed_when: false
- name: remove node-exporter container
docker_container:
name: node_exporter
state: absent
failed_when: false
- name: remove node_exporter service file - name: remove node_exporter service file
file: file:
name: /etc/systemd/system/node_exporter.service name: /etc/systemd/system/node_exporter.service
state: absent state: absent
- name: remove node-exporter image - name: remove node-exporter image
docker_image: command: "{{ container_binary }} rmi {{ node_exporter_container_image }}"
image: "{{ ceph_docker_registry }}/prom/node-exporter"
state: absent
force: yes
tags: tags:
- remove_img - remove_img
failed_when: false
- name: purge ceph grafana-server - name: purge ceph grafana-server
@ -177,10 +168,11 @@
- alertmanager - alertmanager
tasks: tasks:
- name: set ceph_docker_registry value if not set - import_role:
set_fact: name: ceph-defaults
ceph_docker_registry: "docker.io" - import_role:
when: ceph_docker_registry is not defined name: ceph-facts
tasks_from: container_binary
- name: stop services - name: stop services
service: service:
@ -190,13 +182,6 @@
with_items: "{{ grafana_services }}" with_items: "{{ grafana_services }}"
failed_when: false failed_when: false
- name: remove containers
docker_container:
name: "{{ item }}"
state: absent
with_items: "{{ grafana_services }}"
failed_when: false
- name: remove service files - name: remove service files
file: file:
name: "/etc/systemd/system/{{ item }}.service" name: "/etc/systemd/system/{{ item }}.service"
@ -204,16 +189,15 @@
with_items: "{{ grafana_services }}" with_items: "{{ grafana_services }}"
failed_when: false failed_when: false
- name: remove images - name: remove ceph dashboard container images
docker_image: command: "{{ container_binary }} rmi {{ item }}"
name: "{{ item }}"
state: absent
force: yes
with_items: with_items:
- "{{ ceph_docker_registry }}/prom/prometheus" - "{{ prometheus_container_image }}"
- "{{ ceph_docker_registry }}/grafana/grafana" - "{{ grafana_container_image }}"
- "{{ ceph_docker_registry }}/prom/alertmanager" - "{{ alertmanager_container_image }}"
failed_when: false failed_when: false
tags:
- remove_img
- name: remove data - name: remove data
file: file:

View File

@ -141,9 +141,7 @@
- name: purge ceph iscsigws cluster - name: purge ceph iscsigws cluster
hosts: hosts: "{{ iscsi_gw_group_name|default('iscsigws') }}"
- "{{ iscsi_gw_group_name|default('iscsigws') }}"
- iscsi-gws
become: true become: true
tasks: tasks: