diff --git a/tasks/docker.yml b/tasks/docker.yml index 7ec0ab6f..8ac88ecb 100644 --- a/tasks/docker.yml +++ b/tasks/docker.yml @@ -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: