No response from Ipify

I’m attempting to provision my staging server with ansible-playbook server.yml -e env=staging but I keep getting this message.

TASK [common : Retrieve SSH client IP] **************************************************************************************

Using module file /usr/local/lib/python2.7/site-packages/ansible/modules/network/ipify_facts.py
<remote_ip> ESTABLISH LOCAL CONNECTION FOR USER: <local_username>
<remote_ip> EXEC /bin/sh -c '/usr/bin/python && sleep 0'

System info:
  Ansible 2.3.0.0; Darwin
  Trellis at "Ansible 2.3 compatibility"
---------------------------------------------------
No valid or no response from url https://api.ipify.org within 10 seconds
(timeout)
fatal: [<remote_ip>]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_args": {
            "api_url": "https://api.ipify.org",
            "timeout": 10
        }
    }
}

I’ve logged into the server via SSH and ran curl https://api.ipify.org, which indeed returns my IP address.

2 Likes

Trellis runs the ipify_facts module with connection: local so that it retrieves your local machine’s public IP (not your server’s), which it adds to the ip_whitelist variable used with the ferm firewall rules and fail2ban rules to make sure your machine doesn’t get blocked.

Connection issues like this are usually just temporary, so you could try again later. If you need the failed connection/task to stop blocking right now, you could

  ip_whitelist:
    - "{{ (env == 'development') | ternary(ansible_default_ipv4.gateway, ipify_public_ip | default('')) }}"
+   - 12.34.56.78
8 Likes