Open DanielTeraSky opened 2 years ago
Thanks for the feedback @DanielTeraSky , the second option looks more portable. Could you submit a pull-request ?
When you submit the PR, also mention what testing you have done.
Thanks for opening this issue @DanielTeraSky - the interface name (eth0
) is also hardcoded at line #608 this should be set dynamically also.
A potential solution may be setting an $IF_NAME
or similar var early on in the execution.
Something like this may work:
"IF_NAME=$(ip -br l | awk '$1 !~ "lo|vir|wl" { print $1}')"
I have come up with a hacky workaround for my builds in the interim but unfortunately my bash skills aren't up to par to submit a PR for this.
edit: disregard, i see your PR has now been merged. Opened PR https://github.com/aws/amazon-ssm-agent/pull/499 as a follow up
The PR has been pushed, it may take sometime to deploy to all regions, please keep your agent uptodate.
@jaseblenner,
You are right, for Ubuntu, there is one more spot where eth0 has not been fixed. Thanks for opening PR https://github.com/aws/amazon-ssm-agent/pull/499 , I will incorporate it
As part of the domain join script for Unix, there is a line where we get the interface IP address, but the interface name is hard-coded (
eth0
) as you can see here: https://github.com/aws/amazon-ssm-agent/blob/baf58f0dedc4dc84d719101259cea5ed73c9f842/agent/plugins/domainjoin/domainjoin_unix_script.go#L555Although this works for
t2
instance types, it doesn't work fort3
andt3a
since the network interface name has changed toensX
.I suggest to change this line to dynamically fetch the the IP without specifying the interface name. There are 2 options to do this:
This is an important fix as there is currently an issue with this script when running on newer machine types