W3cubDocs

/Ansible

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.

Examples

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

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

Return Values

Common return values are documented here Common 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

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

This is an Extras Module

For more information on what this means please read Extras Modules

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

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/ipify_facts_module.html