ceph-osd: set container objectstore env variables

Because we need to manage legacy ceph-disk based OSD with ceph-volume
then we need a way to know the osd_objectstore in the container.
This was done like this previously with ceph-disk so we should also
do it with ceph-volume.
Note that this won't have any impact for ceph-volume lvm based OSD.

Rename docker_env_args fact to container_env_args and move the container
condition on the include_tasks call.
Remove OSD_DMCRYPT env variable from the ceph-osd template because it's
now included in the container_env_args variable.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1792122

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit c9e1fe3d92)
pull/4969/head
Dimitri Savineau 2020-01-20 11:24:08 -05:00 committed by Dimitri Savineau
parent ff2a2bb870
commit 6a51330892
3 changed files with 10 additions and 17 deletions

View File

@ -1,32 +1,28 @@
--- ---
- name: set_fact docker_env_args '-e osd_bluestore=0 -e osd_filestore=1 -e osd_dmcrypt=0' - name: set_fact container_env_args '-e osd_bluestore=0 -e osd_filestore=1 -e osd_dmcrypt=0'
set_fact: set_fact:
docker_env_args: -e OSD_BLUESTORE=0 -e OSD_FILESTORE=1 -e OSD_DMCRYPT=0 container_env_args: -e OSD_BLUESTORE=0 -e OSD_FILESTORE=1 -e OSD_DMCRYPT=0
when: when:
- containerized_deployment | bool
- osd_objectstore == 'filestore' - osd_objectstore == 'filestore'
- not dmcrypt | bool - not dmcrypt | bool
- name: set_fact docker_env_args '-e osd_bluestore=0 -e osd_filestore=1 -e osd_dmcrypt=1' - name: set_fact container_env_args '-e osd_bluestore=0 -e osd_filestore=1 -e osd_dmcrypt=1'
set_fact: set_fact:
docker_env_args: -e OSD_BLUESTORE=0 -e OSD_FILESTORE=1 -e OSD_DMCRYPT=1 container_env_args: -e OSD_BLUESTORE=0 -e OSD_FILESTORE=1 -e OSD_DMCRYPT=1
when: when:
- containerized_deployment | bool
- osd_objectstore == 'filestore' - osd_objectstore == 'filestore'
- dmcrypt | bool - dmcrypt | bool
- name: set_fact docker_env_args '-e osd_bluestore=1 -e osd_filestore=0 -e osd_dmcrypt=0' - name: set_fact container_env_args '-e osd_bluestore=1 -e osd_filestore=0 -e osd_dmcrypt=0'
set_fact: set_fact:
docker_env_args: -e OSD_BLUESTORE=1 -e OSD_FILESTORE=0 -e OSD_DMCRYPT=0 container_env_args: -e OSD_BLUESTORE=1 -e OSD_FILESTORE=0 -e OSD_DMCRYPT=0
when: when:
- containerized_deployment | bool
- osd_objectstore == 'bluestore' - osd_objectstore == 'bluestore'
- not dmcrypt | bool - not dmcrypt | bool
- name: set_fact docker_env_args '-e osd_bluestore=1 -e osd_filestore=0 -e osd_dmcrypt=1' - name: set_fact container_env_args '-e osd_bluestore=1 -e osd_filestore=0 -e osd_dmcrypt=1'
set_fact: set_fact:
docker_env_args: -e OSD_BLUESTORE=1 -e OSD_FILESTORE=0 -e OSD_DMCRYPT=1 container_env_args: -e OSD_BLUESTORE=1 -e OSD_FILESTORE=0 -e OSD_DMCRYPT=1
when: when:
- containerized_deployment | bool
- osd_objectstore == 'bluestore' - osd_objectstore == 'bluestore'
- dmcrypt | bool - dmcrypt | bool

View File

@ -47,6 +47,7 @@
- name: include container_options_facts.yml - name: include container_options_facts.yml
include_tasks: container_options_facts.yml include_tasks: container_options_facts.yml
when: containerized_deployment | bool
- name: include_tasks scenarios/lvm.yml - name: include_tasks scenarios/lvm.yml
include_tasks: scenarios/lvm.yml include_tasks: scenarios/lvm.yml

View File

@ -41,11 +41,7 @@ numactl \
{% if ansible_distribution == 'Ubuntu' -%} {% if ansible_distribution == 'Ubuntu' -%}
--security-opt apparmor:unconfined \ --security-opt apparmor:unconfined \
{% endif -%} {% endif -%}
{% if dmcrypt -%} {{ container_env_args }} \
-e OSD_DMCRYPT=1 \
{% else -%}
-e OSD_DMCRYPT=0 \
{% endif -%}
-e CLUSTER={{ cluster }} \ -e CLUSTER={{ cluster }} \
{% if (ceph_tcmalloc_max_total_thread_cache | int) > 0 and osd_objectstore == 'filestore' -%} {% if (ceph_tcmalloc_max_total_thread_cache | int) > 0 and osd_objectstore == 'filestore' -%}
-e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }} \ -e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }} \