Rework all the ceph_key invocation to use either docker or podman
binary.
Signed-off-by: Sébastien Han <seb@redhat.com>
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',
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:
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