-
-
Save anonymous/8d326e40b5484e455f269509f269cc0c to your computer and use it in GitHub Desktop.
This file contains 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
# Pastebin 0Dc4Zqj0 | |
Facter.add(:nagios_ipaddress6) do | |
setcode do | |
Facter.value(:networking)['interfaces']. | |
reject { |i,_| i =~ /lo.*/ }. | |
values. | |
map { |x| x['bindings6'] }. | |
flatten. | |
map { |x| x['address'] }. | |
select { |x| valid_addr? x }. | |
sort_by { |x| x.length }. | |
shift | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment