Skip to content

Commit

Permalink
ceph-validate: use root device from ansible_mounts
Browse files Browse the repository at this point in the history
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 7e50380)
  • Loading branch information
dsavineau authored and guits committed Jul 2, 2021
1 parent 5476d60 commit 71c0f2d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions roles/ceph-validate/tasks/check_devices.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 71c0f2d

Please sign in to comment.