]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph_key: use the right container runtime binary
authorSébastien Han <seb@redhat.com>
Sun, 18 Nov 2018 15:10:11 +0000 (16:10 +0100)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Tue, 27 Nov 2018 16:47:40 +0000 (16:47 +0000)
Rework all the ceph_key invocation to use either docker or podman
binary.

Signed-off-by: Sébastien Han <seb@redhat.com>
library/ceph_key.py
roles/ceph-client/tasks/create_users_keys.yml
roles/ceph-osd/tasks/openstack_config.yml

index 3c92419affbbecd4baf40d806feb2e216bc9f3e7..eebda7db637a10a01a1a450ff6f9bf137bc9e262 100644 (file)
@@ -207,7 +207,8 @@ def container_exec(binary, container_image):
     Build the docker CLI to run a command inside a container
     '''
 
-    command_exec = ['docker',
+    container_binary = os.getenv('CEPH_CONTAINER_BINARY')
+    command_exec = [container_binary,
                     'run',
                     '--rm',
                     '--net=host',
index 6a6a5e9730a848a4f3af2e5accb9efbd0c13d157..2d526c69c86563af8d65e2bba931a7e04b39b15b 100644 (file)
@@ -46,6 +46,7 @@
   environment:
     CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
     CEPH_UID: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    CEPH_CONTAINER_BINARY: "{{ container_binary }}"
   with_items: "{{ keys }}"
   delegate_to: "{{ delegated_node }}"
   when:
index d1b6d8e68050a4bbd3fcbf60497f5502ab722363..74bde5d6e485746b6a7da1bf507c32156dc76079 100644 (file)
     name: "{{ item.name }}"
     caps: "{{ item.caps }}"
     secret: "{{ item.key | default('') }}"
-    containerized: "{{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }}"
     cluster: "{{ cluster }}"
     mode: "{{ item.mode|default(omit) }}"
+  environment:
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_UID: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    CEPH_CONTAINER_BINARY: "{{ container_binary }}"
   with_items: "{{ openstack_keys }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   when: cephx