]> git.apps.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:24 +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 780e044ed1a0d6687fcd138e15a2c72346aab98e..e8620a8607c43139f752271389d5b2e3a937ff6c 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 bcdbecea91976994023e67387c7b5688ef0b6a90..bf56df2cfb5e6091ecfa64541bf073fc26974bde 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 4cf563f355d0a9591744d64cf3a7ff9705c9fd66..a5cf3a31240a48210f524e531ef5166b346c66da 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 06eeaa2..0000000
+++ /dev/null
@@ -1,51 +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 -%}
-  --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 }}
index 088903234ef43729742fdb83c793c97ec76e6a26..b49a98e1abd050a29eecc6ca862d0b29c7f837a0 100644 (file)
@@ -7,12 +7,54 @@ 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 -%}
+  --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
index b0fa6ff89a083fbd6dc897baff0d4cc5934372db..f8c227c46fe82a5820b044fe19d442d28627f997 100644 (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
index 92a7247da6cdfea1d446e886e9e0aee3587c7d05..c26159e343fb6d396c71b274dcd53ad41d7fc65e 100644 (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
index 576156ac2b671acac31f2cab7588c4fe90103030..b84e51a9658b2639df2be28d88d198ddac3b9089 100644 (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
index 80d464a7ba6bfb7ca357b82b92ba67985f8d6b61..0949f62248fa5ae63db3a3619282783762ab1d71 100644 (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
index b0b3939485e8be1eaa31de1a206e54ed995809b7..3e16a7749e2b1dc440cab5fb5f21828a0ccea8eb 100644 (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
index 5c1fc51eaf3dac4edf9334c99bcdabba5e56a61a..6f49b68360c014b3aff1fc9be6b700d9a5450f19 100644 (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
index c7a09446950d4cb3261a9e820f6414cf72fd2080..d9859aa5b05a02f0f66c7ae1cb654104329d4445 100644 (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
index ee5c119394f4d8eacaa97b28c925055e81e865e9..71efbc41536a1061d857569c05a0aa2a7c3a5133 100644 (file)
@@ -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
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 7908d1d1438eec578b0c3313c9b005c3d6548774..ccb69f7006bb2c5219eac13cabed3ef6338fde27 100644 (file)
@@ -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
index c0cbb6b6bf5e51fbfd7a5c80307149d2a67f9265..3569d71dfd603e881702052d31622a003a8b2a73 100644 (file)
@@ -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
index 84e21497b274dcbe73f3cbefe9006e5739e35035..4c8294afddab09ffbca9a70ca2a8c0c0ca561950 100644 (file)
@@ -20,7 +20,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
 dashboard_enabled: False
 handler_health_mon_check_delay: 10
 handler_health_osd_check_delay: 10
\ No newline at end of file
index 91c09b7b66dc1218e9233684b65eed171a27b2e8..9f3a0f88857ee6615abf9e6c1c9c51b736a7fee8 100644 (file)
@@ -24,7 +24,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
 dashboard_enabled: False
 handler_health_mon_check_delay: 10
 handler_health_osd_check_delay: 10
\ No newline at end of file
index d136d847d0eda9e41358bbae1fd116efff9918a1..2fb0f924dd772be5acd397921e671bd6a6a794c3 100644 (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
 dashboard_enabled: False
 handler_health_mon_check_delay: 10
 handler_health_osd_check_delay: 10
\ No newline at end of file
index 03aaff786e53b0c91638047221a1e1bf6c477a56..3ea93c23332fbf11dffc235ff47d15a25c08ab2d 100644 (file)
@@ -20,7 +20,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
 dashboard_enabled: False
 handler_health_mon_check_delay: 10
 handler_health_osd_check_delay: 10
\ No newline at end of file
index 4eba291632a0cfefea1d84d8d63be83126b1d2a1..6a27be6f1f28cf9bd3e9aee0e947c4f666b03199 100644 (file)
@@ -64,7 +64,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 52f89d3300b8e24418083db8cdce46fe0e6f6a75..752f68c249f7e5e15236125658d056ae19ba2fa7 100644 (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
index 59407374678b7874398f49e769b4aeaaa9384e60..fa8612d14043ba7b64e78bafd0add0149d6e3fbe 100644 (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
index 70112b26de9092fac220866305152416803e8b19..1329c28ba74f9ed2b69c37ad9d1334ae0316ce42 100644 (file)
@@ -24,5 +24,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
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