From f192bc92a2daa6f3e286d8049ab05effedb300c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Sun, 18 Nov 2018 16:10:11 +0100 Subject: [PATCH] ceph_key: use the right container runtime binary MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Rework all the ceph_key invocation to use either docker or podman binary. Signed-off-by: Sébastien Han --- library/ceph_key.py | 3 ++- roles/ceph-client/tasks/create_users_keys.yml | 1 + roles/ceph-osd/tasks/openstack_config.yml | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/library/ceph_key.py b/library/ceph_key.py index 3c92419af..eebda7db6 100644 --- a/library/ceph_key.py +++ b/library/ceph_key.py @@ -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', diff --git a/roles/ceph-client/tasks/create_users_keys.yml b/roles/ceph-client/tasks/create_users_keys.yml index 6a6a5e973..2d526c69c 100644 --- a/roles/ceph-client/tasks/create_users_keys.yml +++ b/roles/ceph-client/tasks/create_users_keys.yml @@ -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: diff --git a/roles/ceph-osd/tasks/openstack_config.yml b/roles/ceph-osd/tasks/openstack_config.yml index d1b6d8e68..74bde5d6e 100644 --- a/roles/ceph-osd/tasks/openstack_config.yml +++ b/roles/ceph-osd/tasks/openstack_config.yml @@ -65,9 +65,12 @@ 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 -- 2.39.5