Skip to content

Instantly share code, notes, and snippets.

@raphink
Created October 23, 2013 10:34
Show Gist options
  • Save raphink/7116264 to your computer and use it in GitHub Desktop.
Save raphink/7116264 to your computer and use it in GitHub Desktop.
require 'facter/util/ip'
Facter.add(:ipaddresses) do
setcode do
Facter::Util::IP.get_interfaces.map { |i|
Facter::Util::IP.get_interface_value(i, 'ipaddress')
}.select { |v| v }.join(',')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment