Problem:
Hi guys. At the time i’m going to modify partition table for custom RedHat installation. In template I want to use ignoredisk “–only-use=” option and write a value from Foreman Facts gathered by FDI for purpose of selecting the largest disk to install OS. In Foreman GUI i’m able to view facts about hosts disks, their models , size, type , etc. . And faced with problem: how can i get the biggest disk device name, using ERB template? I found one suggestion to solve it
<% disk = disks.sort_by { |d| d[:size_bytes] }.last %>
<%= disk[:device] %>
but it doesn’t work. I’d appreciate any help.
Expected outcome:
nvme0n1 (for example)
Foreman and Proxy versions:
Version 3.8.0
Foreman and Proxy plugin versions:
foreman_discovery|22.0.4
katello 4.10.0
Distribution and version:
RHEL 8