<commit_before>#!/bin/sh

if [ "$CONSUL_ENABLED" = "true" ]; then
  ipaddress="$(ifconfig $NETWORK_INTERFACE | grep 'inet' | tr -s ' ' | cut -d ' ' -f 3)"

  cat <<SERVICEDEF > /puppet-service.json
{
  "name": "puppet",
  "id": "$HOSTNAME",
  "port": $PUPPET_MASTERPORT,
  "address": "$ipaddress",
  "checks": [<commit_msg>(CPR-718) Add resiliency for consul ipaddress checks<commit_after>#!/bin/sh

if [ "$CONSUL_ENABLED" = "true" ]; then
  ipaddress="$(ifconfig $NETWORK_INTERFACE | grep -v 'inet6' | grep 'inet' | head -1 | tr -s ' ' | cut -d ' ' -f 3)"

  cat <<SERVICEDEF > /puppet-service.json
{
  "name": "puppet",
  "id": "$HOSTNAME",
  "port": $PUPPET_MASTERPORT,
  "address": "$ipaddress",
  "checks": [
{'fraction_non_alphanumeric': 0.211781206171108, 'fraction_numerical': 0.009817671809256662, 'mean_word_length': 3.993006993006993, 'pattern_counts': {'":': 10, '<': 7, '<?xml version=': 0, '>': 5, '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': '6742844', 'n_tokens_mistral': 302, 'n_tokens_neox': 291, 'n_words': 65}