]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osd: fix bug in osd activation (container) v3.2.55
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 8 Apr 2021 09:27:26 +0000 (11:27 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 9 Apr 2021 07:12:10 +0000 (09:12 +0200)
8a17433312641fb6fa2f3184849b3d696a774156 introduced a regression for
containerized deployments.

When deploying with `osd_auto_discovery: false` the osds never got
activated.
This commit fixes it.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1947072
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-osd/tasks/start_osds.yml

index 24a7c874987e45b46debb80e10ce27400f29f9bf..664dc5a2e8d7b4f42cbf9505a718694972b0efc4 100644 (file)
           ls /var/lib/ceph/osd/ | sed 's/.*-//'
         register: activated_osds
 
-      - name: auto discovery specific tasks
-        when: osd_auto_discovery | bool
-        block:
-          - name: get prepared disk list
-            command: >
-              docker run --rm --net=host --privileged=true --pid=host --ipc=host --ulimit nofile=1024:4096 --cpu-quota=100000
-              -v /dev:/dev
-              -v /etc/localtime:/etc/localtime:ro
-              -v /var/lib/ceph:/var/lib/ceph:z,rshared
-              -v /etc/ceph:/etc/ceph:z
-              -v /var/run/ceph:/var/run/ceph:z
-              -v /var/run/udev/:/var/run/udev/
-              --entrypoint=ceph-disk
-              {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
-              list --format json
-            register: ceph_disk_list
-
-          - name: set_fact prepared_devices
-            set_fact:
-              prepared_devices: "{{ prepared_devices | default([]) | union([item.path]) }}"
-            with_items: "{{ ceph_disk_list.stdout | default('{}') | from_json }}"
-            when:
-              - ceph_disk_list.skipped is undefined
-              - item.path is defined
-              - item.partitions is defined
-              - (item.partitions | selectattr('type', 'match', 'data') | selectattr('state', 'defined') | map(attribute='state') | default([]) | list == ['prepared']) or
-                (item.partitions | selectattr('type', 'match', 'lockbox') | selectattr('state', 'defined') | map(attribute='state') | list == ['prepared'])
+      - name: get prepared disk list
+        command: >
+          docker run --rm --net=host --privileged=true --pid=host --ipc=host --ulimit nofile=1024:4096 --cpu-quota=100000
+          -v /dev:/dev
+          -v /etc/localtime:/etc/localtime:ro
+          -v /var/lib/ceph:/var/lib/ceph:z,rshared
+          -v /etc/ceph:/etc/ceph:z
+          -v /var/run/ceph:/var/run/ceph:z
+          -v /var/run/udev/:/var/run/udev/
+          --entrypoint=ceph-disk
+          {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
+          list --format json
+        register: ceph_disk_list
+
+      - name: set_fact prepared_devices
+        set_fact:
+          prepared_devices: "{{ prepared_devices | default([]) | union([item.path]) }}"
+        with_items: "{{ ceph_disk_list.stdout | default('{}') | from_json }}"
+        when:
+          - ceph_disk_list.skipped is undefined
+          - item.path is defined
+          - item.partitions is defined
+          - (item.partitions | selectattr('type', 'match', 'data') | selectattr('state', 'defined') | map(attribute='state') | default([]) | list == ['prepared']) or
+            (item.partitions | selectattr('type', 'match', 'lockbox') | selectattr('state', 'defined') | map(attribute='state') | list == ['prepared'])
 
       - name: activate containerized osd(s)
         shell: |