community.general.ipbase_info module – Retrieve IP geolocation and other facts of a host’s IP address using the ipbase.com API
Note
This module is part of the community.general collection (version 10.1.0).
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.ipbase_info
.
New in community.general 7.0.0
Synopsis
Retrieve IP geolocation and other facts of a host’s IP address using the ipbase.com API
Parameters
Parameter |
Comments |
---|---|
The API key for the request if you need more requests. |
|
If the Choices:
|
|
The IP you want to get the info for. If not specified the API will detect the IP automatically. |
|
An ISO Alpha 2 Language Code for localizing the IP data Default: |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full This action does not modify state. |
Can run in |
|
Support: N/A This action does not modify state. |
Will return details on what has changed (or possibly needs changing in |
Notes
Note
Check https://ipbase.com/ for more information.
Examples
- name: "Get IP geolocation information of the primary outgoing IP"
community.general.ipbase_info:
register: my_ip_info
- name: "Get IP geolocation information of a specific IP"
community.general.ipbase_info:
ip: "8.8.8.8"
register: my_ip_info
- name: "Get IP geolocation information of a specific IP with all other possible parameters"
community.general.ipbase_info:
ip: "8.8.8.8"
apikey: "xxxxxxxxxxxxxxxxxxxxxx"
hostname: true
language: "de"
register: my_ip_info
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
JSON parsed response from ipbase.com. Please refer to https://ipbase.com/docs/info for the detailed structure of the response. Returned: success Sample: |