- import_role:
name: ceph-handler
- - name: get docker version
- command: docker --version
- changed_when: false
- check_mode: no
- register: ceph_docker_version
-
- - name: set_fact ceph_docker_version ceph_docker_version.stdout.split
- set_fact:
- ceph_docker_version: "{{ ceph_docker_version.stdout.split(' ')[2] }}"
-
tasks:
- name: set_fact container_binary, container_binding_name, container_service_name, container_package_name
- name: include prerequisites.yml
include_tasks: prerequisites.yml
-- name: get docker version
- block:
- - name: get docker version
- command: docker --version
- changed_when: false
- check_mode: no
- register: ceph_docker_version
-
- - name: set_fact ceph_docker_version ceph_docker_version.stdout.split
- set_fact:
- ceph_docker_version: "{{ ceph_docker_version.stdout.split(' ')[2] }}"
- when: container_binary == 'docker'
-
- name: include registry.yml
include_tasks: registry.yml
when: ceph_docker_registry_auth | bool
ExecStartPre=-/usr/bin/{{ container_binary }} rm rbd-target-api
ExecStart=/usr/bin/{{ container_binary }} run --rm \
--memory={{ ceph_rbd_target_api_docker_memory_limit }} \
- {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_rbd_target_api_docker_cpu_limit }} \
- {% else -%}
- --cpu-quota={{ ceph_rbd_target_api_docker_cpu_limit * 100000 }} \
- {% endif -%}
-v /etc/localtime:/etc/localtime:ro \
--privileged \
--cap-add=ALL \
ExecStartPre=-/usr/bin/{{ container_binary }} rm rbd-target-gw
ExecStart=/usr/bin/{{ container_binary }} run --rm \
--memory={{ ceph_rbd_target_gw_docker_memory_limit }} \
- {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_rbd_target_gw_docker_cpu_limit }} \
- {% else -%}
- --cpu-quota={{ ceph_rbd_target_gw_docker_cpu_limit * 100000 }} \
- {% endif -%}
-v /etc/localtime:/etc/localtime:ro \
--privileged \
--cap-add=ALL \
ExecStartPre=-/usr/bin/{{ container_binary }} rm tcmu-runner
ExecStart=/usr/bin/{{ container_binary }} run --rm \
--memory={{ ceph_tcmu_runner_docker_memory_limit }} \
- {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_tcmu_runner_docker_cpu_limit }} \
- {% else -%}
- --cpu-quota={{ ceph_tcmu_runner_docker_cpu_limit * 100000 }} \
- {% endif -%}
-v /etc/localtime:/etc/localtime:ro \
--privileged \
--net=host \
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mds-{{ ansible_hostname }}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
--memory={{ ceph_mds_docker_memory_limit }} \
- {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ cpu_limit }} \
- {% else -%}
- --cpu-quota={{ cpu_limit * 100000 }} \
- {% endif -%}
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/run/ceph:/var/run/ceph:z \
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mgr-{{ ansible_hostname }}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
--memory={{ ceph_mgr_docker_memory_limit }} \
- {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_mgr_docker_cpu_limit }} \
- {% else -%}
- --cpu-quota={{ ceph_mgr_docker_cpu_limit * 100000 }} \
- {% endif -%}
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/run/ceph:/var/run/ceph:z \
ExecStartPre=/bin/sh -c '"$(command -v mkdir)" -p /etc/ceph /var/lib/ceph/mon'
ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-mon-%i \
--memory={{ ceph_mon_docker_memory_limit }} \
-{% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_mon_docker_cpu_limit }} \
-{% else -%}
- --cpu-quota={{ ceph_mon_docker_cpu_limit * 100000 }} \
-{% endif -%}
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/run/ceph:/var/run/ceph:z \
{% if osd_objectstore == 'filestore' -%}
--memory={{ ceph_osd_docker_memory_limit }} \
{% endif -%}
- {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ cpu_limit }} \
- {% else -%}
- --cpu-quota={{ cpu_limit * 100000 }} \
- {% endif -%}
{% if ceph_osd_docker_cpuset_cpus is defined -%}
--cpuset-cpus='{{ ceph_osd_docker_cpuset_cpus }}' \
{% endif -%}
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rbd-mirror-{{ ansible_hostname }}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
--memory={{ ceph_rbd_mirror_docker_memory_limit }} \
- {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ ceph_rbd_mirror_docker_cpu_limit }} \
- {% else -%}
- --cpu-quota={{ ceph_rbd_mirror_docker_cpu_limit * 100000 }} \
- {% endif -%}
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/run/ceph:/var/run/ceph:z \
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rgw-{{ ansible_hostname }}-${INST_NAME}
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
--memory={{ ceph_rgw_docker_memory_limit }} \
- {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%}
--cpus={{ cpu_limit }} \
- {% else -%}
- --cpu-quota={{ cpu_limit * 100000 }} \
- {% endif -%}
{% if ceph_rgw_docker_cpuset_cpus is defined -%}
--cpuset-cpus="{{ ceph_rgw_docker_cpuset_cpus }}" \
{% endif -%}