From 16585b6e58da75d74b213b22309d03fabba9b05c Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sat, 14 Mar 2009 20:32:22 +0000 Subject: [PATCH] A mounts fact. This will hopefully let us compare what we currently monitor to what is actually on the system Signed-off-by: Stephen Gran --- facts/mounts.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 facts/mounts.rb diff --git a/facts/mounts.rb b/facts/mounts.rb new file mode 100644 index 00000000..c1c6aaba --- /dev/null +++ b/facts/mounts.rb @@ -0,0 +1,17 @@ +require 'filesystem' + +Facter.add("mounts") do + ignorefs = ["NFS", "nfs", "nfs4", "afs", "binfmt_misc", "proc", "smbfs", + "autofs", "iso9660", "ncpfs", "coda", "devpts", "ftpfs", "devfs", + "mfs", "shfs", "sysfs", "cifs", "lustre_lite", "tmpfs", "usbfs", "udf"] + mountpoints = [] + FileSystem.mounts.each do |m| + if not ignorefs.include?(m.fstype) && m.options !~ /bind/ + mountpoints << m.mount + end + end + setcode do + mountpoints.join(',') + end +end + -- 2.39.2