community / community.general / 0.1.4 / module / ipify_facts Retrieve the public IP of your internet gateway Authors: René Moser (@resmo)community.general.ipify_facts (0.1.4) — module
Install with ansible-galaxy collection install community.general:==0.1.4
collections: - name: community.general version: 0.1.4
If behind NAT and need to know the public IP of your internet gateway.
# 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
api_url: default: https://api.ipify.org/ description: - URL of the ipify.org API service. - C(?format=json) will be appended per default. type: str timeout: default: 10 description: - HTTP connection timeout in seconds. type: int validate_certs: default: true description: - When set to C(NO), SSL certificates will not be validated. type: bool
ipify_public_ip: description: Public IP of the internet gateway. returned: success sample: 1.2.3.4 type: str