Perfect! Thanks Martin.
On Sunday, December 18, 2022 at 10:35:59 AM UTC+2 Martin Alfke wrote: > Hi Nir, > > do you only need the capacity from the root file system? > > You can access the data hash directly: > $facts['mountpoints']['/']['capacity'] > > hth, > Martin > > > > On 18. Dec 2022, at 08:44, Nir Fishler <[email protected]> wrote: > > > > Hey Guys, > > > > I'm trying to pull data from an array using the 'mountpoints' facter > > > > $root_partition = $mountpoints.filter |$values| { $values[0] =~ "/$" } > > > > the results I get are: > > > > Notice: {/ => {device => /dev/mapper/ubuntu--vg-ubuntu--lv, filesystem > => ext4, options => [rw, relatime], size_bytes => 262901354496, > available_bytes => 240302788608, used_bytes => 11734274048, capacity => > 4.66%, size => 244.85 GiB, available => 223.80 GiB, used => 10.93 GiB}} > > Notice: /Stage[main]/Disk_usage/Notify[{/ => {device => > /dev/mapper/ubuntu--vg-ubuntu--lv, filesystem => ext4, options => [rw, > relatime], size_bytes => 262901354496, available_bytes => 240302788608, > used_bytes => 11734274048, capacity => 4.66%, size => 244.85 GiB, available > => 223.80 GiB, used => 10.93 GiB}}]/message: defined 'message' as '{/ => > {device => /dev/mapper/ubuntu--vg-ubuntu--lv, filesystem => ext4, options > => [rw, relatime], size_bytes => 262901354496, available_bytes => > 240302788608, used_bytes => 11734274048, capacity => 4.66%, size => 244.85 > GiB, available => 223.80 GiB, used => 10.93 GiB}}' > > > > What I need is the get the 'capacity' value out of it. > > > > > > Thanks! > > Nir. > > > > -- > > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected]. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/a3de8dab-287c-40da-be6c-c8036bba38c5n%40googlegroups.com > . > > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/0cd95451-576d-44e9-b55a-a37d522ddfa4n%40googlegroups.com.
