]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-validate: use root device from ansible_mounts
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 15 Dec 2020 20:04:57 +0000 (15:04 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 5 Jul 2021 16:03:43 +0000 (18:03 +0200)
Instead of using findmnt command to find the device associated to the
root mount point then we can use the ansible_mounts fact.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 7e50380f7fc101bf3533fff2d9c3082a59c54399)

roles/ceph-validate/tasks/check_devices.yml

index a8e2622bd3c1ba0581d77a14ee72abf202b1b296..6fa21894203884e68f04dc17a990ee5d3b496866 100644 (file)
@@ -1,17 +1,7 @@
 ---
-- name: find device used for operating system
-  command: findmnt -v -n -T / -o SOURCE
-  changed_when: false
-  register: root_device
-
-- name: resolve root_device
-  command: "readlink -f {{ root_device.stdout }}"
-  changed_when: false
-  register: _root_device
-
 - name: set_fact root_device
   set_fact:
-    root_device: "{{ _root_device.stdout }}"
+    root_device: "{{ ansible_facts['mounts'] | selectattr('mount', 'match', '^/$') | map(attribute='device') | first }}"
 
 - name: lvm_volumes variable's tasks related
   when: