-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terraform in Equinix Metal: Fix NAT to reference correct interfaces #76
Conversation
Still need to do a full reprovision test. The commands worked manually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
Updated per feedback from @mmlb. Looking for further feedback if this new approach is good. |
NAT_INTERFACE=$(cat .nat_interface) | ||
fi | ||
if [ -n "$NAT_INTERFACE" ] && ip addr show "$NAT_INTERFACE" &>/dev/null; then | ||
# TODO(nshalman) the terraform code would just run these commands as-is once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ubuntu has some sort of iptables-persist package iirc. Yep iptables-persistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I try to get that wired up, or land as is with the TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo is fine imo, hasn't been an issue so far I think.
This moves the NAT commands from terraform to setup.sh Signed-off-by: Nahum Shalman <nshalman@equinix.com>
Squashed and ready to land if everyone likes this. |
I say it is ready to ship |
## Description This is a follow-up to #76 which introduced a failure: ``` provisioner: ./setup.sh: line 117: NAT_INTERFACE: unbound variable ``` ## Why is this needed Unbreak `setup.sh` when used by Vagrant Fixes #77 ## How Has This Been Tested? I used the following simple test case. It works now that the variable is declared first, but still breaks as reported without the fix. ```bash #!/bin/bash set -eu NAT_INTERFACE="" if [ -r .nat_interface ]; then NAT_INTERFACE=$(cat .nat_interface) fi if [ -n "$NAT_INTERFACE" ] && ip addr show "$NAT_INTERFACE" &>/dev/null; then echo "$NAT_INTERFACE" fi ``` ## How are existing users impacted? What migration steps/scripts do we need? Vagrant users are currently broken as reported in the community Slack. ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
Description
The NAT setup commands assume that the interface is named eth1, when clearly from the documentation it is named
enp1s0f1
. This commit fixes the NAT setup commands accordingly.Why is this needed
NAT doesn't work by default on Equinix Metal when following the documentation
How Has This Been Tested?
How are existing users impacted? What migration steps/scripts do we need?
Existing sandboxes (that are broken) should either be rebuilt, or can run the commands manually to enable NAT
Checklist:
I have: