puppet-jenkins/lib/facter/memorytotalbytes.rb
Ian Wienand f2d759d1f5 Don't use -o argument to "free"
The /bin/free on Fedora 21 doesn't understand -o argument to free;
that being:

---
 -o, --old
   Display the output in old format, the only difference being this
   option will disable the display of the "buffer adjusted" line.
---

i.e. the difference is the "-/+ buffers/cache" line.  Since the sed
only matches on the line starting "^Mem", this is not relevant anyway.

Change-Id: Ib2f763ea82b9a3b397d202453099d58e5dd5a355
2014-11-06 10:39:36 +11:00

8 lines
169 B
Ruby
Executable File

# memorytotalbytes.rb
Facter.add("memorytotalbytes") do
setcode do
Facter::Util::Resolution.exec('free -b | sed -n \'s/^Mem:\W\+\([0-9]\+\).*$/\1/p\'')
end
end