ipify_facts – Retrieve the public IP of your internet gateway — Ansible Documentation

- AnsibleFest
- Products
- Community
- Webinars & Training
- Blog

Documentation

# ipify_facts – Retrieve the public IP of your internet gateway

New in version 2.0.

- Synopsis
- Parameters
- Notes
- Examples
- Return Values
- Status

## Synopsis

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

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
api_url string | Default: "https://api.ipify.org/" | URL of the ipify.org API service. `?format=json` will be appended per default.
timeout integer added in 2.3 | Default: 10 | HTTP connection timeout in seconds.
validate_certs boolean added in 2.4 | Choices: no yes ← | When set to `NO`, SSL certificates will not be validated.

## Notes

Note

- Visit https://www.ipify.org to get more information.

## 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, the following are the fields unique to this module:

Key | Returned | Description
--- | --- | ---
ipify_public_ip string | success | Public IP of the internet gateway. Sample: 1.2.3.4

## Status

- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]

### Authors

- René Moser (@resmo)

Hint

If you notice any issues in this documentation you can edit this document to improve it.