Uploaded image for project: 'Insights Experiences'
  1. Insights Experiences
  2. HMS-1567

Temporary IP/FQDN in inventory via tags

    • Icon: Task Task
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • Provisioning
    • None

      Inventory backend and UI supports tags, which is a free-form key-value items that do appear in the UI. It is possible to create a cloud-init script that will download and create those tags via insights-client:

      TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
      PUBLIC_IP4=$(/usr/bin/curl -s -H "X-aws-ec2-metadata-token: $TOKEN" --connect-timeout 5 http://169.254.169.254/latest/meta-data/public-ipv4)
      PUBLIC_HOSTNAME=$(/usr/bin/curl -s -H "X-aws-ec2-metadata-token: $TOKEN" --connect-timeout 5 http://169.254.169.254/latest/meta-data/public-hostname)
      
      echo "---" > /etc/insights-client/tags.yaml
      echo "Public hostname: $PUBLIC_HOSTNAME" >> /etc/insights-client/tags.yaml
      echo "Public IPv4: $PUBLIC_IP4" >> /etc/insights-client/tags.yaml
      

      Let’s add this as a temporary (backup) solution if we don’t hit the full implementation for the summit.

              rhn-engineering-lzapletal Lukáš Zapletal
              rhn-engineering-lzapletal Lukáš Zapletal
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: