forem / selfhost

Selfhost your Forem Community on your own infrastructure 🎉
https://www.forem.com/get-started/
GNU Affero General Public License v3.0
1.44k stars 172 forks source link

Provisioning may fail if `local_wan_ip_address` is IPv6 #7

Closed andygeorge closed 3 years ago

andygeorge commented 3 years ago

The "Fetch public WAN IP json" Ansible task can potentially retrieve an IPv6 address, depending on the user's home ISP connection. When that happens, other tasks may fail due to how local_wan_ip_address is used, eg https://github.com/forem/selfhost/blob/main/playbooks/providers/aws.yml#L154

andygeorge commented 3 years ago

We could either update the README to explicitly support only IPv4, or look into how much effort supporting IPv6 will be.

0bserver07 commented 3 years ago

I had to change the "icanhazip.com" to something else, it kept returning IPV6:

https://github.com/forem/selfhost/blob/main/roles/preflight/tasks/main.yml#L4-L9


- name: Fetch public WAN IP json
  ansible.builtin.uri:
    url: https://checkip.amazonaws.com/
    return_content: yes
  changed_when: no
  register: local_wan_json
jdoss commented 3 years ago

@0bserver07 If you have time to PR this change we'd merge it. If not I can do it later.

leewynne commented 3 years ago

Hi there, just a quick update from me on my testing with this so far.

Previously I was getting this issues when deploying into an existing VPC (I have no default ones). No ipv6 configured.

Yesterday I recreated a fresh default VPC, again with no ipv6 - just all the defaults, same issue.

andygeorge commented 3 years ago

fresh default VPC, again with no ipv6

Hey @leewynne! Note that this issue refers to the "Fetch public WAN IP json" Ansible task (which is run locally on your workstation) returning an IPv6 address, and is not related to your cloud configuration. I have updated the issue content to make that more clear.

leewynne commented 3 years ago

Ah right! that makes total sense now - thanks for that 😎😎😎