Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add machine readable size facts. #347

Open
markdv77 opened this issue Aug 8, 2024 · 0 comments
Open

Add machine readable size facts. #347

markdv77 opened this issue Aug 8, 2024 · 0 comments

Comments

@markdv77
Copy link

markdv77 commented Aug 8, 2024

Use Case

I would like to use our centralized facts databases, The Froreman, to e.g. get al list of hosts that e.g. currently don't have X amounts of free space in some volume group. Pretend we have plans to add a volume on all hosts, and would like to know on how many we do/don't have the room for it. But this sort of query doesn't work on these human readable numbers.

volume_groups => {
  vg00 => {
    free => "152.00m",
    size => "<95.99g",
  }
}

Describe the Solution You Would Like

Some additional numerical properties that express the sizes in bytes would solve this issue. This seems to be common solution used by other facts like 'disks', 'memory', 'mountpoints' and 'partitions' as well, so this would fit right in. One example of the 'mountpoints ' fact:

mountpoints => {
  / => {
    available => "1.77 GiB",
    available_bytes => 1898541056,
    capacity => "0.92%",    device => "/dev/mapper/vg00-root",    filesystem => "ext4",
    options => [      "rw",      "noatime",      "errors=remount-ro"    ],
    size => "1.90 GiB",
    size_bytes => 2040373248,
    used => "16.86 MiB",
    used_bytes => 17682432
  },

Please consider doing the same with this fact.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant