我正在尝试(mount => "/")
使用 Puppet 因子获取根分区名称。当我运行“ facter partitions
”时,它显示了三个分区。我想从结果中获取变量“sda3”。
{
/dev/sda1 => {
size => "1.00 MiB",
size_bytes => 1048576
},
/dev/sda2 => {
filesystem => "ext2",
mount => "/boot",
size => "477.00 MiB",
size_bytes => 500170752,
uuid => "8345d60e-e09a-4723-b5a6-149f4002706d"
},
/dev/sda3 => {
filesystem => "ext4",
mount => "/",
size => "49.71 GiB",
size_bytes => 53376712704,
uuid => "a1330fb2-7f13-417e-8908-813b1fdae911"
},
我试过$hddname = $facts['partitions']['mount'] == "/"
了,但出错了。你们有什么想法吗?