community.general.ipinfoio_facts – Retrieve IP geolocation facts of a host’s IP address
Note
This plugin is part of the community.general collection (version 3.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
.
Parameters
Parameter |
Comments |
---|---|
Set http user agent Default: “ansible-ipinfoio-module/0.0.1” |
|
HTTP connection timeout in seconds Default: 10 |
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: “Mountain View” |
|
ISO 3166-1 alpha-2 country code Returned: success Sample: “US” |
|
Domain name Returned: success Sample: “google-public-dns-a.google.com” |
|
Public IP address of a host Returned: success Sample: “8.8.8.8” |
|
Latitude and Longitude of the location Returned: success Sample: “37.3860,-122.0838” |
|
organization’s name Returned: success Sample: “AS3356 Level 3 Communications, Inc.” |
|
Postal code Returned: success Sample: “94035” |
|
State or province name Returned: success Sample: “California” |
Authors
Aleksei Kostiuk (@akostyuk)