community.general.ipify_facts module – Retrieve the public IP of your internet gateway
Note
This module is part of the community.general collection (version 4.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.ipify_facts
.
Parameters
Parameter |
Comments |
---|---|
URL of the ipify.org API service.
Default: “https://api.ipify.org/” |
|
HTTP connection timeout in seconds. Default: 10 |
|
When set to Choices:
|
Notes
Note
Visit https://www.ipify.org to get more information.
Examples
# Gather IP facts from ipify.org
- name: Get my public IP
community.general.ipify_facts:
# Gather IP facts from your own ipify service endpoint with a custom timeout
- name: Get my public IP
community.general.ipify_facts:
api_url: http://api.example.com/ipify
timeout: 20
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Public IP of the internet gateway. Returned: success Sample: “1.2.3.4” |
Authors
René Moser (@resmo)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication