Signed-off-by: Paul Nasrat <[EMAIL PROTECTED]>
---
lib/facter/macaddress.rb | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/lib/facter/macaddress.rb b/lib/facter/macaddress.rb
index 30d4b59..98e38b8 100644
--- a/lib/facter/macaddress.rb
+++ b/lib/facter/macaddress.rb
@@ -63,3 +63,17 @@ Facter.add(:macaddress) do
ether[0]
end
end
+
+Facter.add(:macaddress) do
+ confine :kernel => %w(windows)
+ setcode do
+ ether = []
+ output = %x{ipconfig /all}
+ output.split(/\r\n/).each do |str|
+ if str =~ /.*Physical Address.*:
(\w{1,2}-\w{1,2}-\w{1,2}-\w{1,2}-\w{1,2}-\w{1,2})/
+ ether.push($1.gsub(/-/, ":"))
+ end
+ end
+ ether[0]
+ 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
-~----------~----~----~----~------~----~------~--~---