Signed-off-by: Paul Nasrat <[EMAIL PROTECTED]>
---
 lib/facter/ipaddress.rb |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/lib/facter/ipaddress.rb b/lib/facter/ipaddress.rb
index 942c134..c97abe4 100644
--- a/lib/facter/ipaddress.rb
+++ b/lib/facter/ipaddress.rb
@@ -149,3 +149,22 @@ Facter.add(:ipaddress) do
         ip
     end
 end
+
+Facter.add(:ipaddress) do
+    confine :kernel => %w{windows}
+    setcode do
+        ip = nil
+        output = %x{ipconfig}
+
+        output.split(/^\S/).each { |str|
+            if str =~ /IP Address.*: ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/
+                tmp = $1
+                unless tmp =~ /127\./
+                    ip = tmp
+                    break
+                end
+            end
+        }
+        ip
+    end
+end
-- 
1.5.3.4


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to