Skip to content

Instantly share code, notes, and snippets.

@andristeiner
Created January 29, 2015 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andristeiner/af974e493e51881de8af to your computer and use it in GitHub Desktop.
Save andristeiner/af974e493e51881de8af to your computer and use it in GitHub Desktop.
Facter ipaddress6_reverse
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