add check and remove for docker-py

This commit is contained in:
Malpractis 2020-01-23 08:37:39 +11:00 committed by GitHub
parent 6a46e5065a
commit b3d1fe6630
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,19 @@
state: present
register: result
until: result is succeeded
- name: 'Check if docker-py is installed'
shell: pip3 show docker-py
ignore_errors: true
register: docker_py_check
- name: 'Remove docker-py if installed'
pip:
name: docker-py
state: absent
when: docker_py_check.stdout.find('docker-py') != -1
register: result
until: result is succeeded
- name: 'Install docker python module'
pip: