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