Commit 829990e6 authored by Dimitri Savineau's avatar Dimitri Savineau Committed by Guillaume Abrioux
Browse files

ceph-osd: remove ceph-osd-run.sh script



Since we only have one scenario since nautilus then we can just move
the container start command from ceph-osd-run.sh to the systemd unit
service.
As a result, the ceph-osd-run.sh.j2 template and the
ceph_osd_docker_run_script_path variable are removed.
Signed-off-by: default avatarDimitri Savineau <dsavinea@redhat.com>
parent d6775961
......@@ -190,7 +190,6 @@ dummy:
# ACTIVATE DEVICE
#
#ceph_osd_docker_extra_env:
#ceph_osd_docker_run_script_path: "/usr/share" # script called by systemd to run the docker command
#ceph_osd_numactl_opts: ""
###########
......
......@@ -323,18 +323,6 @@
- "{{ playbook_dir }}/group_vars/osds.yml"
skip: true
- name: find all osd_disk_prepare logs
find:
paths: "{{ ceph_osd_docker_run_script_path | default('/usr/share') }}"
pattern: "ceph-osd-prepare-*.log"
register: osd_disk_prepare_logs
- name: ensure all osd_disk_prepare logs are removed
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ osd_disk_prepare_logs.files }}"
- name: purge ceph mon cluster
hosts: "{{ mon_group_name|default('mons') }}"
......
......@@ -182,7 +182,6 @@ ceph_osd_docker_prepare_env: -e OSD_JOURNAL_SIZE={{ journal_size }}
# ACTIVATE DEVICE
#
ceph_osd_docker_extra_env:
ceph_osd_docker_run_script_path: "/usr/share" # script called by systemd to run the docker command
ceph_osd_numactl_opts: ""
###########
......
---
- name: generate ceph osd docker run script
become: true
template:
src: "{{ role_path }}/templates/ceph-osd-run.sh.j2"
dest: "{{ ceph_osd_docker_run_script_path }}/ceph-osd-run.sh"
owner: "root"
group: "root"
mode: "0744"
setype: "bin_t"
notify: restart ceph osds
- name: generate systemd unit file
become: true
template:
src: "{{ role_path }}/templates/ceph-osd.service.j2"
dest: /etc/systemd/system/ceph-osd@.service
......
#!/bin/bash
# {{ ansible_managed }}
########
# MAIN #
########
{% set cpu_limit = ansible_processor_vcpus|int if ceph_osd_docker_cpu_limit|int > ansible_processor_vcpus|int else ceph_osd_docker_cpu_limit|int %}
{% if ceph_osd_numactl_opts != "" %}
numactl \
{{ ceph_osd_numactl_opts }} \
{% endif %}
/usr/bin/{{ container_binary }} run \
--rm \
--net=host \
--privileged=true \
--pid=host \
--ipc=host \
{% if osd_objectstore == 'filestore' -%}
--memory={{ ceph_osd_docker_memory_limit }} \
{% endif -%}
--cpus={{ cpu_limit }} \
{% if ceph_osd_docker_cpuset_cpus is defined -%}
--cpuset-cpus='{{ ceph_osd_docker_cpuset_cpus }}' \
{% endif -%}
{% if ceph_osd_docker_cpuset_mems is defined -%}
--cpuset-mems='{{ ceph_osd_docker_cpuset_mems }}' \
{% endif -%}
-v /dev:/dev \
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/run/ceph:/var/run/ceph:z \
-v /var/run/udev/:/var/run/udev/ \
-v /var/log/ceph:/var/log/ceph:z \
{% if ansible_distribution == 'Ubuntu' -%}
--security-opt apparmor:unconfined \
{% endif -%}
{{ container_env_args }} \
-e CLUSTER={{ cluster }} \
{% 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 }} \
{% endif -%}
-v /run/lvm/:/run/lvm/ \
-e CEPH_DAEMON=OSD_CEPH_VOLUME_ACTIVATE \
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
-e OSD_ID="$1" \
--name=ceph-osd-"$1" \
{{ ceph_osd_docker_extra_env }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
......@@ -6,12 +6,54 @@ After=docker.service
{% else %}
After=network.target
{% endif %}
{% set cpu_limit = ansible_processor_vcpus|int if ceph_osd_docker_cpu_limit|int > ansible_processor_vcpus|int else ceph_osd_docker_cpu_limit|int %}
[Service]
EnvironmentFile=-/etc/environment
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-osd-%i
ExecStartPre=-/usr/bin/{{ container_binary }} rm -f ceph-osd-%i
ExecStart={{ ceph_osd_docker_run_script_path }}/ceph-osd-run.sh %i
ExecStart={% if ceph_osd_numactl_opts != "" %}
numactl \
{{ ceph_osd_numactl_opts }} \
{% endif %}
/usr/bin/{{ container_binary }} run \
--rm \
--net=host \
--privileged=true \
--pid=host \
--ipc=host \
{% if osd_objectstore == 'filestore' -%}
--memory={{ ceph_osd_docker_memory_limit }} \
{% endif -%}
--cpus={{ cpu_limit }} \
{% if ceph_osd_docker_cpuset_cpus is defined -%}
--cpuset-cpus='{{ ceph_osd_docker_cpuset_cpus }}' \
{% endif -%}
{% if ceph_osd_docker_cpuset_mems is defined -%}
--cpuset-mems='{{ ceph_osd_docker_cpuset_mems }}' \
{% endif -%}
-v /dev:/dev \
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/run/ceph:/var/run/ceph:z \
-v /var/run/udev/:/var/run/udev/ \
-v /var/log/ceph:/var/log/ceph:z \
{% if ansible_distribution == 'Ubuntu' -%}
--security-opt apparmor:unconfined \
{% endif -%}
{{ container_env_args }} \
-e CLUSTER={{ cluster }} \
{% 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 }} \
{% endif -%}
-v /run/lvm/:/run/lvm/ \
-e CEPH_DAEMON=OSD_CEPH_VOLUME_ACTIVATE \
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
-e OSD_ID=%i \
--name=ceph-osd-%i \
{{ ceph_osd_docker_extra_env }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
ExecStop=-/usr/bin/{{ container_binary }} stop ceph-osd-%i
KillMode=none
Restart=always
......
......@@ -26,5 +26,4 @@ ceph_conf_overrides:
mon_allow_pool_size_one: true
mon_warn_on_pool_no_redundancy: false
osd_pool_default_size: 1
ceph_osd_docker_run_script_path: /var/tmp
dashboard_enabled: False
\ No newline at end of file
......@@ -26,5 +26,4 @@ ceph_conf_overrides:
mon_allow_pool_size_one: true
mon_warn_on_pool_no_redundancy: false
osd_pool_default_size: 1
ceph_osd_docker_run_script_path: /var/tmp
dashboard_enabled: False
\ No newline at end of file
......@@ -26,5 +26,4 @@ ceph_conf_overrides:
mon_allow_pool_size_one: true
mon_warn_on_pool_no_redundancy: false
osd_pool_default_size: 1
ceph_osd_docker_run_script_path: /var/tmp
dashboard_enabled: False
\ No newline at end of file
......@@ -26,5 +26,4 @@ ceph_conf_overrides:
mon_allow_pool_size_one: true
mon_warn_on_pool_no_redundancy: false
osd_pool_default_size: 1
ceph_osd_docker_run_script_path: /var/tmp
dashboard_enabled: False
\ No newline at end of file
......@@ -26,5 +26,4 @@ ceph_conf_overrides:
mon_allow_pool_size_one: true
mon_warn_on_pool_no_redundancy: false
osd_pool_default_size: 1
ceph_osd_docker_run_script_path: /var/tmp
dashboard_enabled: False
\ No newline at end of file
......@@ -26,7 +26,6 @@ ceph_conf_overrides:
mon_allow_pool_size_one: true
mon_warn_on_pool_no_redundancy: false
osd_pool_default_size: 1
ceph_osd_docker_run_script_path: /var/tmp
rgw_override_bucket_index_max_shards: 16
rgw_bucket_default_quota_max_objects: 1638400
dashboard_enabled: False
\ No newline at end of file
......@@ -35,7 +35,6 @@ rgw_create_pools:
ec_profile: myecprofile
ec_k: 2
ec_m: 1
ceph_osd_docker_run_script_path: /var/tmp
osd_objectstore: "bluestore"
lvm_volumes:
- data: data-lv1
......
......@@ -20,7 +20,6 @@ ceph_conf_overrides:
osd_pool_default_size: 1
handler_health_mon_check_delay: 10
handler_health_osd_check_delay: 10
ceph_osd_docker_run_script_path: /var/tmp
osd_objectstore: "bluestore"
lvm_volumes:
- data: data-lv1
......
---
ceph_osd_docker_run_script_path: /var/tmp
osd_objectstore: "bluestore"
lvm_volumes:
- data: data-lv1
......
---
ceph_osd_docker_run_script_path: /var/tmp
osd_objectstore: "bluestore"
lvm_volumes:
- data: data-lv1
......
---
ceph_osd_docker_run_script_path: /var/tmp
osd_objectstore: "bluestore"
lvm_volumes:
- data: data-lv1
......
---
ceph_osd_docker_run_script_path: /var/tmp
osd_objectstore: "bluestore"
lvm_volumes:
- data: data-lv1
......
......@@ -28,7 +28,6 @@ rgw_create_pools:
pg_num: 16
bar:
pg_num: 16
ceph_osd_docker_run_script_path: /var/tmp
osd_objectstore: "bluestore"
lvm_volumes:
- data: data-lv1
......
......@@ -20,7 +20,6 @@ ceph_conf_overrides:
osd_pool_default_size: 1
handler_health_mon_check_delay: 10
handler_health_osd_check_delay: 10
ceph_osd_docker_run_script_path: /var/tmp
osd_objectstore: "bluestore"
lvm_volumes:
- data: data-lv1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment