]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Add section for purging rgw loadbalancer in purge-cluster.yml
authorguihecheng <guihecheng@cmiot.chinamobile.com>
Fri, 1 Mar 2019 07:51:43 +0000 (15:51 +0800)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 6 Jun 2019 15:12:04 +0000 (17:12 +0200)
Signed-off-by: guihecheng <guihecheng@cmiot.chinamobile.com>
infrastructure-playbooks/purge-cluster.yml

index a3b15e16cd5e0f70ba90429b1dfe3dfc9419eedd..f4daf0e1c5332a5158817cd8c874d0b79ad834df 100644 (file)
     failed_when: false
     when: ansible_service_mgr == 'systemd'
 
+- name: purge rgwloadbalancer cluster
+
+  vars:
+    rgwloadbalancer_group_name: rgwloadbalancers
+
+  hosts:
+    - "{{ rgwloadbalancer_group_name|default('rgwloadbalancers') }}"
+
+  gather_facts: false # Already gathered previously
+
+  become: true
+
+  tasks:
+
+  - name: stop rgwloadbalancer services
+    service:
+      name: ['keepalived', 'haproxy']
+      state: stopped
+      enabled: no
+    failed_when: false
 
 - name: purge ceph rgw cluster
 
       - python-rados
       - python-rbd
 
+    extra_packages:
+      - keepalived
+      - haproxy
+
   hosts:
     - "{{ mon_group_name|default('mons') }}"
     - "{{ osd_group_name|default('osds') }}"
       - ansible_pkg_mgr == 'apt'
       - purge_all_packages | bool
 
+  - name: purge extra packages with yum
+    yum:
+      name: "{{ extra_packages }}"
+      state: absent
+    when:
+      - ansible_pkg_mgr == 'yum'
+      - purge_all_packages == true
+
+  - name: purge extra packages with dnf
+    dnf:
+      name: "{{ extra_packages }}"
+      state: absent
+    when:
+      - ansible_pkg_mgr == 'dnf'
+      - purge_all_packages == true
+
+  - name: purge extra packages with apt
+    apt:
+      name: "{{ extra_packages }}"
+      state: absent
+    when:
+      - ansible_pkg_mgr == 'apt'
+      - purge_all_packages == true
+
   - name: remove config
     file:
-     path: /etc/ceph
-     state: absent
+      path: "{{ item }}"
+      state: absent
+    with_items:
+      - /etc/ceph
+      - /etc/keepalived
+      - /etc/haproxy
 
   - name: remove logs
     file: