]> git-server-git.apps.pok.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)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Thu, 6 Jun 2019 19:44:30 +0000 (19:44 +0000)
Signed-off-by: guihecheng <guihecheng@cmiot.chinamobile.com>
(cherry picked from commit 59e702ec39f5b6b109138f30aa6c45b56b544554)

infrastructure-playbooks/purge-cluster.yml

index 005486e51c2196fd4b584cd616bb8e152a7ffb49..c9d469ac732cc4cc2499be3d9baba65e767b8cf2 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 == true
 
+  - 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: