]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-osd: remove ceph-osd-run.sh script
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 9 Jun 2020 19:19:57 +0000 (15:19 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 23 Jun 2020 15:35:01 +0000 (17:35 +0200)
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: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 829990e60d8569198e3fc849624131a7cf6ddf84)

35 files changed:
group_vars/osds.yml.sample
infrastructure-playbooks/purge-container-cluster.yml
roles/ceph-osd/defaults/main.yml
roles/ceph-osd/tasks/systemd.yml
roles/ceph-osd/templates/ceph-osd-run.sh.j2 [deleted file]
roles/ceph-osd/templates/ceph-osd.service.j2
tests/functional/add-mdss/container/group_vars/all
tests/functional/add-mgrs/container/group_vars/all
tests/functional/add-mons/container/group_vars/all
tests/functional/add-osds/container/group_vars/all
tests/functional/add-rbdmirrors/container/group_vars/all
tests/functional/add-rgws/container/group_vars/all
tests/functional/all-in-one/container/group_vars/all
tests/functional/all-in-one/group_vars/all
tests/functional/all_daemons/container/group_vars/osds
tests/functional/collocation/container/group_vars/osds
tests/functional/collocation/group_vars/osds
tests/functional/docker2podman/group_vars/osds
tests/functional/external_clients/container/inventory/group_vars/all
tests/functional/external_clients/inventory/group_vars/all
tests/functional/filestore-to-bluestore/container/group_vars/all
tests/functional/lvm-auto-discovery/container/group_vars/all
tests/functional/lvm-batch/container/group_vars/all
tests/functional/lvm-osds/container/group_vars/all
tests/functional/ooo-collocation/hosts
tests/functional/podman/group_vars/osds
tests/functional/rgw-multisite/container/group_vars/all
tests/functional/rgw-multisite/container/secondary/group_vars/all
tests/functional/rgw-multisite/secondary/group_vars/all
tests/functional/shrink_mds/container/group_vars/osds
tests/functional/shrink_mgr/container/group_vars/osds
tests/functional/shrink_mon/container/group_vars/osds
tests/functional/shrink_osd/container/group_vars/osds
tests/functional/shrink_rbdmirror/container/group_vars/osds
tests/functional/shrink_rgw/container/group_vars/osds

index ebd8c6243803fad4090e01cf82f5189d001d98af..60b2bfbd21602b3029252278c2f713a369a99761 100644 (file)
@@ -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: ""
 
 ###########
index 61ac03906312a9407a1e4b02f02e86321fb158c4..d074f43adda993a385e602fe0dc8731183c3da9d 100644 (file)
         - "{{ 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') }}"
index 24ef3ec0886bef15493843daf5dfb077ce17301d..4658401862fd7036cb61ea2762442a31a13b3262 100644 (file)
@@ -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: ""
 
 ###########
index 4992e5ee4747e4f4645f594fbe28194342d27c83..367d49ec37968e26ffe1f5ce0711919eafe1072d 100644 (file)
@@ -1,17 +1,5 @@
 ---
-- 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
diff --git a/roles/ceph-osd/templates/ceph-osd-run.sh.j2 b/roles/ceph-osd/templates/ceph-osd-run.sh.j2
deleted file mode 100644 (file)
index 31b2ac3..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/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 -%}
-  {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version('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 -%}
-  {% 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 }}
index 088903234ef43729742fdb83c793c97ec76e6a26..8346ecf282b9c41b12408ccb70c3a825021a0dbd 100644 (file)
@@ -7,12 +7,58 @@ Requires=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 -%}
+  {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version('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 -%}
+  {% 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
index 99ef186333afdee93bd06d61c30c35a92adeccf8..53004263c070a0d2bfb296285ae5061036938ec2 100644 (file)
@@ -24,5 +24,4 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
\ No newline at end of file
index 8f38b036945a7f4833f9804843c06d4200bdf24d..2ca46b7248f6b9f6af429fd1b531ef28e0d0c705 100644 (file)
@@ -25,5 +25,4 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
\ No newline at end of file
index 59f694283cb487628486c24b4b9358ebe504650e..feb44cc5c33799db7924f28929d71b02343827e7 100644 (file)
@@ -25,5 +25,4 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
\ No newline at end of file
index 1c034763c056916e8e880144083582ed13501854..dce64e858f9c6c14ab0dd3cf8cd27a1e02a35df6 100644 (file)
@@ -24,5 +24,4 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
\ No newline at end of file
index bdaad7a6ad3728c036f852854b57cf0e01da9bd7..c4b5eb0112a9defa7ebf823aaf1f155ac2ae3208 100644 (file)
@@ -25,5 +25,4 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
\ No newline at end of file
index 705cfca71b237acfef953ec1721e9b96360956a6..b0ce8d72c08abc9b56bb3c8efdc77e41c4330312 100644 (file)
@@ -25,7 +25,6 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     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
index 8ed94b1ec12fe94ce7c262569a8a1c35ca6ab28d..5662f58da97b047a69ff750c144127e59ce0f3df 100644 (file)
@@ -33,7 +33,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
index 837bb92438c8f10d62e3ae0f595c8f0dd95aa832..72d14dd5bc3e4753b324c5739b899789a290ccb7 100644 (file)
@@ -18,7 +18,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
index 9cea91d6a3646229fa4abac8ec254b94445d9adb..27268d4065017d2da5868a893d95623380b5a8b4 100644 (file)
@@ -1,5 +1,4 @@
 ---
-ceph_osd_docker_run_script_path: /var/tmp
 osd_objectstore: "bluestore"
 lvm_volumes:
   - data: data-lv1
index 9cea91d6a3646229fa4abac8ec254b94445d9adb..27268d4065017d2da5868a893d95623380b5a8b4 100644 (file)
@@ -1,5 +1,4 @@
 ---
-ceph_osd_docker_run_script_path: /var/tmp
 osd_objectstore: "bluestore"
 lvm_volumes:
   - data: data-lv1
index 9cea91d6a3646229fa4abac8ec254b94445d9adb..27268d4065017d2da5868a893d95623380b5a8b4 100644 (file)
@@ -1,5 +1,4 @@
 ---
-ceph_osd_docker_run_script_path: /var/tmp
 osd_objectstore: "bluestore"
 lvm_volumes:
   - data: data-lv1
index 9cea91d6a3646229fa4abac8ec254b94445d9adb..27268d4065017d2da5868a893d95623380b5a8b4 100644 (file)
@@ -1,5 +1,4 @@
 ---
-ceph_osd_docker_run_script_path: /var/tmp
 osd_objectstore: "bluestore"
 lvm_volumes:
   - data: data-lv1
index 81c1801912366e19af4841c87213beb0ff0a9673..095003acfb717cfdf905b99e72e36eb349f1f337 100644 (file)
@@ -27,7 +27,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
index d24010440a413ab00b4fdce0c8368638410c5533..276b8dfaff9e6783ee6f61bdcd650a862ea36dc3 100644 (file)
@@ -19,7 +19,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
index f4e16b46beb9e5dbfd9e6e8285f1bce579f79c1c..96f8160164228501a14041bc14f40eaeea6c7b6d 100644 (file)
@@ -19,7 +19,6 @@ ceph_conf_overrides:
   global:
     mon_warn_on_pool_no_redundancy: false
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
 handler_health_mon_check_delay: 10
 handler_health_osd_check_delay: 10
\ No newline at end of file
index d153e47c44c7b50ad7df1e1be5353bd20c4797f8..1e550bea32042876209ace24e0a32560d988aa32 100644 (file)
@@ -22,7 +22,6 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
 handler_health_mon_check_delay: 10
 handler_health_osd_check_delay: 10
\ No newline at end of file
index ebbfb503e5b885a66b27e3196137ecf0c53bbd58..fa97ee5f719850a8f88f2c7ea68a938ac0bae830 100644 (file)
@@ -24,7 +24,6 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
 handler_health_mon_check_delay: 10
 handler_health_osd_check_delay: 10
\ No newline at end of file
index 63e2676fdf797179ae2e7ee0cadb66178187f6a6..5e05c0d575a9e7e6ed3a03db64c2a30c94d4d608 100644 (file)
@@ -18,7 +18,6 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
 handler_health_mon_check_delay: 10
 handler_health_osd_check_delay: 10
\ No newline at end of file
index e9c2f099a41ed9386c922cb5077d5fa515bed8ab..e8ecb039aa0a368487dffa7f611be13026c5c073 100644 (file)
@@ -63,7 +63,6 @@ all:
     - {name: backups, pg_num: 8, rule_name: 'replicated_rule'}
     - {name: vms, pg_num: 8, rule_name: 'replicated_rule'}
     - {name: volumes, pg_num: 8, rule_name: 'replicated_rule'}
-    ceph_osd_docker_run_script_path: /opt
     pools: []
     public_network: 192.168.95.0/24
     radosgw_address_block: 192.168.95.0/24
index 9cea91d6a3646229fa4abac8ec254b94445d9adb..27268d4065017d2da5868a893d95623380b5a8b4 100644 (file)
@@ -1,5 +1,4 @@
 ---
-ceph_osd_docker_run_script_path: /var/tmp
 osd_objectstore: "bluestore"
 lvm_volumes:
   - data: data-lv1
index 7087c53a6482faca62c5de101f61c8c1a5a54724..3a7955519e4504347dbf41e0a847d3f13e4f31e6 100644 (file)
@@ -24,5 +24,4 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
\ No newline at end of file
index 35a3ce6c76b6e5ea76e94b5060a41add8e91e624..8a5ac17fea7fdd23e5e7e82c762549af4f71f889 100644 (file)
@@ -24,5 +24,4 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
\ No newline at end of file
index ebb9e53d1c3f08347e9d945848549f972352bff7..7b5fd03ffa51ae16601f9356470bb6428b359f60 100644 (file)
@@ -22,5 +22,4 @@ os_tuning_params:
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
-ceph_osd_docker_run_script_path: /var/tmp
 dashboard_enabled: False
\ No newline at end of file
index 9cea91d6a3646229fa4abac8ec254b94445d9adb..27268d4065017d2da5868a893d95623380b5a8b4 100644 (file)
@@ -1,5 +1,4 @@
 ---
-ceph_osd_docker_run_script_path: /var/tmp
 osd_objectstore: "bluestore"
 lvm_volumes:
   - data: data-lv1
index 9cea91d6a3646229fa4abac8ec254b94445d9adb..27268d4065017d2da5868a893d95623380b5a8b4 100644 (file)
@@ -1,5 +1,4 @@
 ---
-ceph_osd_docker_run_script_path: /var/tmp
 osd_objectstore: "bluestore"
 lvm_volumes:
   - data: data-lv1
index 9cea91d6a3646229fa4abac8ec254b94445d9adb..27268d4065017d2da5868a893d95623380b5a8b4 100644 (file)
@@ -1,5 +1,4 @@
 ---
-ceph_osd_docker_run_script_path: /var/tmp
 osd_objectstore: "bluestore"
 lvm_volumes:
   - data: data-lv1
index 2558deb1be2e117460ed267b27f9eccfc9c63d63..c9149bd5017a82166cbbb4806a84e4124b7f1a3a 100644 (file)
@@ -1,5 +1,4 @@
 ---
-ceph_osd_docker_run_script_path: /var/tmp
 journal_size: 100
 osd_objectstore: "filestore"
 lvm_volumes:
index 9cea91d6a3646229fa4abac8ec254b94445d9adb..27268d4065017d2da5868a893d95623380b5a8b4 100644 (file)
@@ -1,5 +1,4 @@
 ---
-ceph_osd_docker_run_script_path: /var/tmp
 osd_objectstore: "bluestore"
 lvm_volumes:
   - data: data-lv1
index 9cea91d6a3646229fa4abac8ec254b94445d9adb..27268d4065017d2da5868a893d95623380b5a8b4 100644 (file)
@@ -1,5 +1,4 @@
 ---
-ceph_osd_docker_run_script_path: /var/tmp
 osd_objectstore: "bluestore"
 lvm_volumes:
   - data: data-lv1