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 <dsavinea@redhat.com>
(cherry picked from commit 7e50380f7f)
pull/6670/head
Dimitri Savineau 2020-12-15 15:04:57 -05:00 committed by Guillaume Abrioux
parent 23ddab7f53
commit f8ecb08ec2
1 changed files with 1 additions and 11 deletions

View 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 - name: set_fact root_device
set_fact: 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 - name: lvm_volumes variable's tasks related
when: when: