]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
container: Add python3-docker on Ubuntu bionic
authorDimitri Savineau <dsavinea@redhat.com>
Wed, 27 Mar 2019 18:11:20 +0000 (14:11 -0400)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Thu, 28 Mar 2019 08:03:58 +0000 (08:03 +0000)
When installing python-minimal on Ubuntu bionic, this will add the
/usr/bin/python symlink to the default python interpreter.
On bionic, this isn't python2 but python3.

$ /usr/bin/python --version
Python 3.6.7

The python docker library is only installed for python2 which causes
issues when running the purge-docker-cluster playbook. This playbook
uses the ansible docker modules and requires to have python bindings
installed on the remote host.
Without the bindings we can see python error reported by the docker
module.

msg: Failed to import docker or docker-py - No module named 'docker'.
Try `pip install docker` or `pip install docker-py` (Python 2.6)

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
roles/ceph-container-common/tasks/pre_requisites/prerequisites.yml

index 127e3e265e0de750eb6ee5bbc4fe75dec9e53218..e6d001a873edfe84df663401bef8f1bb87cbd707 100644 (file)
         update_cache: yes
       register: result
       until: result is succeeded
-      tags:
-        with_pkg
+
+    - name: install python3-docker on bionic
+      package:
+        name: python3-docker
+        state: present
+        update_cache: yes
+      register: result
+      until: result is succeeded
+      when: ansible_lsb.codename == 'bionic'
   when:
     - ansible_distribution == 'Ubuntu'
+  tags:
+    with_pkg
 
 # ensure extras enabled for docker
 - name: enable extras on centos