community.general.ipify_facts – Retrieve the public IP of your internet gateway
Note
This plugin is part of the community.general collection (version 3.8.1).
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
.
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 | Default: 10 | HTTP connection timeout in seconds. |
validate_certs boolean |
| 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 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 | Returned | Description |
---|---|---|
ipify_public_ip string | success | Public IP of the internet gateway. Sample: 1.2.3.4 |
Authors
- René Moser (@resmo)
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/ipify_facts_module.html