我想使用木偶因素獲得根分區(mountpoint => "/")
名稱。當我運行"facter mountpoints"
時,它顯示多個分區。我想從結果中獲得變量"/dev/md3"
。木偶:使用因素過濾器獲取安裝點
{
/=> {
available => "893.71 GiB",
available_bytes => 959608590336,
capacity => "1.86%",
device => "/dev/md3",
filesystem => "ext4",
options => [
"rw",
"errors=remount-ro"
],
size => "910.69 GiB",
size_bytes => 977843884032,
used => "16.98 GiB",
used_bytes => 18235293696
},
/run => {
available => "794.91 MiB",
available_bytes => 833527808,
capacity => "0.07%",
device => "tmpfs",
filesystem => "tmpfs",
options => [
"rw",
"noexec",
"nosuid",
"size=10%",
"mode=0755"
],
size => "795.48 MiB",
size_bytes => 834125824,
used => "584.00 KiB",
used_bytes => 598016
},
/tmp => {
available => "1.78 GiB",
available_bytes => 1909157888,
capacity => "1.21%",
device => "/dev/md1",
filesystem => "ext4",
options => [
"rw"
],
size => "1.80 GiB",
size_bytes => 1932533760,
used => "22.29 MiB",
used_bytes => 23375872
}
}
我試圖使用過濾器,但我無法過濾"/"
設備。 $root_mount = $facts['mountpoints'].filter |$mountpoint| { $mountpoint == '/' }
你們有什麼想法嗎?
太好了!非常感謝 – Mike