]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Add dnf package support; change condition checks for package managers
authorKGoreczny <krzysztof.goreczny@intel.com>
Mon, 15 Feb 2016 15:51:16 +0000 (16:51 +0100)
committerKGoreczny <krzysztof.goreczny@intel.com>
Mon, 15 Feb 2016 15:51:16 +0000 (16:51 +0100)
Signed-off-by: KGoreczny <krzysztof.goreczny@intel.com>
purge-cluster.yml

index ec9a44c268bfe987ada5640ed5abcd3c2fcac485..54f8171c8819b1c5cc6c9f066ab9d88fff253110 100644 (file)
@@ -47,7 +47,7 @@
       state: stopped
       enabled: no
     when:
-      ansible_distribution != 'Ubuntu' and
+      ansible_os_family == 'RedHat' and
       ceph_stable_release == 'infernalis'
 
   - name: stop ceph-osd with systemd
@@ -57,7 +57,7 @@
       enabled: no
     with_items: "{{ osd_ids.stdout_lines }}"
     when:
-      ansible_distribution != 'Ubuntu' and
+      ansible_os_family == 'RedHat' and
       ceph_stable_release == 'infernalis' and
       osd_group_name in group_names
 
@@ -67,7 +67,7 @@
       state: stopped
       enabled: no
     when:
-      ansible_distribution != 'Ubuntu' and
+      ansible_os_family == 'RedHat' and
       ceph_stable_release == 'infernalis' and
       mon_group_name in group_names 
 
@@ -76,7 +76,7 @@
       name: ceph-mds@{{ ansible_hostname }} 
       state: stopped
     when:
-      ansible_distribution != 'Ubuntu' and
+      ansible_os_family == 'RedHat' and
       ceph_stable_release == 'infernalis' and
       mds_group_name in group_names 
 
   - name: stop ceph osds
     command: service ceph stop osd
     when:
-      ansible_distribution != 'Ubuntu' and
+      ansible_os_family == 'RedHat' and
       osd_group_name in group_names and
       ceph_stable_release != 'infernalis'
 
   - name: stop ceph mons
     command: service ceph stop mon
     when:
-      ansible_distribution != 'Ubuntu' and
+      ansible_os_family == 'RedHat' and
       mon_group_name in group_names and
       ceph_stable_release != 'infernalis'
 
   - name: stop ceph mdss
     command: service ceph stop mds
     when:
-      ansible_distribution != 'Ubuntu' and
+      ansible_os_family == 'RedHat' and
       mds_group_name in group_names and
       ceph_stable_release != 'infernalis'
 
     with_items:
       - "{{ ceph_packages }}"
     when:
-      ansible_distribution != 'Ubuntu'
+      ansible_pkg_mgr == 'yum'
+
+  - name: purge ceph packages with dnf
+    dnf:
+      name: "{{ item }}"
+      state: absent
+    with_items:
+      - "{{ ceph_packages }}"
+    when:
+      ansible_pkg_mgr == 'dnf'
 
   - name: purge ceph packages with apt
     apt:
     with_items:
       - "{{ ceph_packages }}"
     when:
-      ansible_distribution == 'Ubuntu'
+      ansible_pkg_mgr == 'apt'
 
   - name: purge remaining ceph packages with yum
     yum:
     with_items:
       - "{{ ceph_remaining_packages }}"
     when:
-      ansible_distribution != 'Ubuntu' and
+      ansible_pkg_mgr == 'yum' and
+      purge_all_packages == true
+
+  - name: purge remaining ceph packages with dnf
+    dnf:
+      name: "{{ item }}"
+      state: absent
+    with_items:
+      - "{{ ceph_remaining_packages }}"
+    when:
+      ansible_pkg_mgr == 'dnf' and
       purge_all_packages == true
 
   - name: purge remaining ceph packages with apt
     with_items:
       - "{{ ceph_remaining_packages }}"
     when:
-      ansible_distribution == 'Ubuntu' and
+      ansible_pkg_mgr == 'apt' and
       purge_all_packages == true
 
   - name: remove config