Created
January 29, 2015 07:56
-
-
Save andristeiner/af974e493e51881de8af to your computer and use it in GitHub Desktop.
Facter ipaddress6_reverse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Facter.add("ipaddress6_reverse") do | |
confine :ipaddress6 | |
setcode do | |
file = "/proc/net/if_inet6" | |
if FileTest.exists?(file) | |
open(file).grep(/eth0/)[0].split.first.chomp.reverse.scan(/.{1}|.+/).join(".") + ".ip6.arpa." | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment