community.general.ipinfoio_facts (8.5.0) — module

Retrieve IP geolocation facts of a host's IP address

Authors: Aleksei Kostiuk (@akostyuk)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Gather IP geolocation facts of a host's IP address using ipinfo.io API

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Retrieve geolocation data of a host's IP address
- name: Get IP geolocation data
  community.general.ipinfoio_facts:

Inputs

    
timeout:
    default: 10
    description:
    - HTTP connection timeout in seconds
    required: false
    type: int

http_agent:
    default: ansible-ipinfoio-module/0.0.1
    description:
    - Set http user agent
    required: false
    type: str

Outputs

ansible_facts:
  contains:
    city:
      description: City name
      sample: Mountain View
      type: str
    country:
      description: ISO 3166-1 alpha-2 country code
      sample: US
      type: str
    hostname:
      description: Domain name
      sample: google-public-dns-a.google.com
      type: str
    ip:
      description: Public IP address of a host
      sample: 8.8.8.8
      type: str
    loc:
      description: Latitude and Longitude of the location
      sample: 37.3860,-122.0838
      type: str
    org:
      description: organization's name
      sample: AS3356 Level 3 Communications, Inc.
      type: str
    postal:
      description: Postal code
      sample: '94035'
      type: str
    region:
      description: State or province name
      sample: California
      type: str
  description: Dictionary of ip geolocation facts for a host's IP address
  returned: changed
  type: complex