<commit_before># What IP does our FQDN resolve to?
#
# Except in some cases (e.g. our FQDN is in .intranet.epfl.ch and we
# are not joined to the domain yet), it is fatal to Kerberos for the
# result not to be == ${::ipaddress}.

require 'logger'
require 'resolv'

$logger = Logger.new(STDERR)

Facter.add("fqdn_ip") do
  fqdn = Facter.value(:fqdn)
  setcode do
    Resolv.getaddress(fqdn)
  end
end<commit_msg>Rescue Resolv::ResolvError<commit_after># What IP does our FQDN resolve to?
#
# Except in some cases (e.g. our FQDN is in .intranet.epfl.ch and we
# are not joined to the domain yet), it is fatal to Kerberos for the
# result not to be == ${::ipaddress}.

require 'logger'
require 'resolv'

$logger = Logger.new(STDERR)

Facter.add("fqdn_ip") do
  fqdn = Facter.value(:fqdn)
  setcode do
    begin
      Resolv.getaddress(fqdn)
    rescue Resolv::ResolvError
      ""
    end
  end
end
{'fraction_non_alphanumeric': 0.11173184357541899, 'fraction_numerical': 0.0, 'mean_word_length': 3.6424870466321244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6052842', 'n_tokens_mistral': 339, 'n_tokens_neox': 344, 'n_words': 112}