From fc2ace7ba078e17e99f9990a56659c7931580637 Mon Sep 17 00:00:00 2001 From: KGoreczny Date: Mon, 15 Feb 2016 16:01:00 +0100 Subject: [PATCH] Use yum and apt modules instead of package to provide Ansible <2.0 support; fix typo Signed-off-by: KGoreczny --- purge-cluster.yml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/purge-cluster.yml b/purge-cluster.yml index b531a6dd8..ec9a44c26 100644 --- a/purge-cluster.yml +++ b/purge-cluster.yml @@ -11,7 +11,7 @@ vars: # When set to true both groups of packages are purged. -# This can couse problem with qemu-kvm +# This can cause problem with qemu-kvm purge_all_packages: true ceph_packages: @@ -147,20 +147,42 @@ when: osd_group_name in group_names - - name: purge ceph packages - package: + - name: purge ceph packages with yum + yum: name: "{{ item }}" state: absent with_items: - "{{ ceph_packages }}" + when: + ansible_distribution != 'Ubuntu' - - name: purge remaining ceph packages - package: + - name: purge ceph packages with apt + apt: + name: "{{ item }}" + state: absent + with_items: + - "{{ ceph_packages }}" + when: + ansible_distribution == 'Ubuntu' + + - name: purge remaining ceph packages with yum + yum: name: "{{ item }}" state: absent with_items: - "{{ ceph_remaining_packages }}" when: + ansible_distribution != 'Ubuntu' and + purge_all_packages == true + + - name: purge remaining ceph packages with apt + apt: + name: "{{ item }}" + state: absent + with_items: + - "{{ ceph_remaining_packages }}" + when: + ansible_distribution == 'Ubuntu' and purge_all_packages == true - name: remove config -- 2.39.5