]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Updates to containerized purge cluster playbook 911/head
authorIvan Font <ivan.font@redhat.com>
Thu, 28 Jul 2016 14:55:37 +0000 (07:55 -0700)
committerIvan Font <ivan.font@redhat.com>
Thu, 28 Jul 2016 14:55:37 +0000 (07:55 -0700)
- Reorder package removal steps
- Remove package dependencies after package is removed

Signed-off-by: Ivan Font <ivan.font@redhat.com>
purge-docker-cluster.yml

index 82961383c1f2b294a69f2609768344b3fafdebaf..3f33cbdacf0fb83cac7668a2190062c773ee729f 100644 (file)
       enabled: no
     when: not is_atomic
 
+  - name: remove docker-py
+    pip:
+      name: docker-py
+      version: 1.1.0
+      state: absent
+    when:
+      ansible_version['full'] | version_compare('2.1.0.0', '<') and
+      not is_atomic
+
+  - name: remove docker-py
+    pip:
+      name: docker-py
+      state: absent
+    when:
+      ansible_version['full'] | version_compare('2.1.0.0', '>=') and
+      not is_atomic
+
+  - name: remove six
+    pip:
+      name: six
+      version: 1.9.0
+      state: absent
+    when: not is_atomic
+
   - name: remove pip and docker on ubuntu
     apt:
       name: "{{ item }}"
       state: absent
       update_cache: yes
+      autoremove: yes
     with_items:
       - python-pip
       - docker
       name: "{{ item }}"
       state: absent
       update_cache: yes
+      autoremove: yes
     with_items:
       - python-pip
       - docker-engine
       ansible_os_family == 'RedHat' and
       ansible_pkg_mgr == "yum" and
       not is_atomic
-    failed_when: false
 
   # for CentOS
   - name: remove docker on redhat
       ansible_os_family == 'RedHat' and
       ansible_pkg_mgr == "yum" and
       not is_atomic
-    failed_when: false
 
   - name: remove pip and docker on redhat
     dnf:
       ansible_pkg_mgr == "dnf" and
       not is_atomic
 
-  - name: remove six
-    pip:
-      name: six
-      version: 1.9.0
-      state: absent
-    when: not is_atomic
+  - name: remove package dependencies on redhat
+    command: yum -y autoremove
+    when:
+      ansible_os_family == 'RedHat' and
+      ansible_pkg_mgr == "yum" and
+      not is_atomic
 
-  - name: remove docker-py
-    pip:
-      name: docker-py
-      version: 1.1.0
-      state: absent
+  - name: remove package dependencies on redhat again
+    command: yum -y autoremove
     when:
-      ansible_version['full'] | version_compare('2.1.0.0', '<') and
+      ansible_os_family == 'RedHat' and
+      ansible_pkg_mgr == "yum" and
       not is_atomic
 
-  - name: remove docker-py
-    pip:
-      name: docker-py
-      state: absent
+  - name: remove package dependencies on redhat
+    command: dnf -y autoremove
     when:
-      ansible_version['full'] | version_compare('2.1.0.0', '>=') and
+      ansible_os_family == 'RedHat' and
+      ansible_pkg_mgr == "dnf" and
+      not is_atomic
+
+  - name: remove package dependencies on redhat again
+    command: dnf -y autoremove
+    when:
+      ansible_os_family == 'RedHat' and
+      ansible_pkg_mgr == "dnf" and
       not is_atomic