ansible / ansible.builtin / v2.9.24 / module / ipify_facts Retrieve the public IP of your internet gateway | "added in version" 2.0 of ansible.builtin" Authors: René Moser (@resmo) preview | supported by communityansible.builtin.ipify_facts (v2.9.24) — module
pip
Install with pip install ansible==2.9.24
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 version_added: '2.3' version_added_collection: ansible.builtin validate_certs: default: true description: - When set to C(NO), SSL certificates will not be validated. type: bool version_added: '2.4' version_added_collection: ansible.builtin
ipify_public_ip: description: Public IP of the internet gateway. returned: success sample: 1.2.3.4 type: str