From: Dimitri Savineau Date: Tue, 15 Dec 2020 20:04:57 +0000 (-0500) Subject: ceph-validate: use root device from ansible_mounts X-Git-Tag: v5.0.8~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=71c0f2d6e11d6dc7d9e2c80ef1273f7f65405404;p=ceph-ansible.git ceph-validate: use root device from ansible_mounts 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 (cherry picked from commit 7e50380f7fc101bf3533fff2d9c3082a59c54399) --- diff --git a/roles/ceph-validate/tasks/check_devices.yml b/roles/ceph-validate/tasks/check_devices.yml index a8e2622bd..6fa218942 100644 --- a/roles/ceph-validate/tasks/check_devices.yml +++ b/roles/ceph-validate/tasks/check_devices.yml @@ -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: