]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
shrink-osd: fix purge osd on containerized deployment
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 13 Sep 2018 09:18:56 +0000 (11:18 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 13 Sep 2018 16:14:01 +0000 (18:14 +0200)
ce1dd8d introduced the purge osd on containers but it was incorrect.

`resolve parent device` and `zap ceph osd disks` tasks must be delegated to
their respective OSD nodes.
Indeed, they were run on the ansible node, it means it was trying to
resolve parent devices from this node where it should be done on OSD
nodes.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1612095
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/shrink-osd.yml

index 1e6397fe18c739344f3be14d8e964dd9ea6eb9ce..f1c2d82f46f3bc09b2e33f15e222d95bc2aec73f 100644 (file)
         - containerized_deployment
 
     - name: resolve parent device
-      command: lsblk --nodeps -no pkname "{{ item.stdout }}"
+      command: lsblk --nodeps -no pkname "{{ item.0.stdout }}"
       register: resolved_parent_device
-      with_items:
+      delegate_to: "{{ item.1 }}"
+      with_together:
         - "{{ osd_to_kill_disks.results }}"
+        - "{{ osd_hosts }}"
       when:
         - containerized_deployment
 
       shell: |
         docker run --rm \
         --privileged=true \
-        --name ceph-osd-zap-{{ ansible_hostname }}-{{ item.stdout }} \
+        --name ceph-osd-zap-{{ ansible_hostname }}-{{ item.0.stdout }} \
         -v /dev/:/dev/ \
-        -e OSD_DEVICE=/dev/{{ item.stdout }} \
+        -e OSD_DEVICE=/dev/{{ item.0.stdout }} \
         {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
         zap_device
-      with_items:
+      delegate_to: "{{ item.1 }}"
+      with_together:
         - "{{ resolved_parent_device.results }}"
+        - "{{ osd_hosts }}"
       when:
         - containerized_deployment