community.general.ipinfoio_facts module – Retrieve IP geolocation facts of a host’s IP address
Note
This module is part of the community.general collection (version 5.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.ipinfoio_facts
.
Synopsis
Gather IP geolocation facts of a host’s IP address using ipinfo.io API
Parameters
Parameter |
Comments |
---|---|
Set http user agent Default: |
|
HTTP connection timeout in seconds Default: |
Notes
Note
Check http://ipinfo.io/ for more information
Examples
# Retrieve geolocation data of a host's IP address
- name: Get IP geolocation data
community.general.ipinfoio_facts:
Returned Facts
Facts returned by this module are added/updated in the hostvars
host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them.
Key |
Description |
---|---|
City name Returned: success Sample: |
|
ISO 3166-1 alpha-2 country code Returned: success Sample: |
|
Domain name Returned: success Sample: |
|
Public IP address of a host Returned: success Sample: |
|
Latitude and Longitude of the location Returned: success Sample: |
|
organization’s name Returned: success Sample: |
|
Postal code Returned: success Sample: |
|
State or province name Returned: success Sample: |
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication