Documentation

ipify_facts - Retrieve the public IP of your internet gateway.

New in version 2.0.

Synopsis

  • If behind NAT and need to know the public IP of your internet gateway.

Options

parameter required default choices comments
api_url
no https://api.ipify.org
URL of the ipify.org API service.
?format=json will be appended per default.
timeout
(added in 2.3)
no 10
HTTP connection timeout in seconds.

Examples

# Gather IP facts from ipify.org
- name: get my public IP
  ipify_facts:

# Gather IP facts from your own ipify service endpoint with a custom timeout
- name: get my public IP
  ipify_facts:
    api_url: http://api.example.com/ipify
    timeout: 20

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
ipify_public_ip Public IP of the internet gateway. success string 1.2.3.4


Notes

Note

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.