aws / aws/amazon-ssm-agent

Request enhancements to hostname setting

Open
#328 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.2k
Forks
357
PR merge metrics
No merged PRs in 30d

Description

Good afternoon to you all!

If you're in the USA (or outside of it, but observant), I hope you had a wonderful Thanksgiving!

Our organization has a few requests for enhancements to the seamless domain join for Linux/Unix instances that would make our lives tremendously easier:

I'll start (in this issue) with ones to the hostname setting. Specifically, this function:

https://github.com/aws/amazon-ssm-agent/blob/215d334a3d8204f37883399a5b81882b47951650/agent/plugins/domainjoin/domainjoin_unix_script.go#L60

(First, it's good work, it's well documented, and it's a clever approach).

Enhancements in no particular order

1. Move to 15 characters for random hostnames - While collisions are unlikely in the 6 character name space, 15 characters is the same amount that you would get with full IP addresses, with all octets filled and dots or dashes, for consistency. xxx.xxx.xxx.xxx for instance, same as 15 characters. It's mostly just a consistency suggestion. No other reason.

2. Allow the hostname to be overriden with a userdata variable. What this variable should be is up to you, but you already set REGION in another step via a curl call, so it's possible. Minor error checking to see if the variable is set, and then use the userdata supplied variable for hostname setting. Yes, there are cases where it wouldn't work (duplicates), in which case, a random name could be used, which would be a further enhancement, true.

3. Similar to a userdata variable, allow the hostname to overriden with an EC2 tag (again, what this tag name should be is up to you). This would be extraordinarily helpful as well.

4. Simply allow existing hostname to be obeyed and not set to a new random hostname. We set the hostname specifically, and having a random hostname set upon join is quite frustrating at times. There's no straightforward way to change it. We have to leave/join the domain again to change it. It would be far simple if we simply set the hostname to what we want, and this script would allow a variable, option, or userdata, to not mangle it, and join with the shortname/hostname already set.

Thank you again for the excellent work on this, and while helpful, these enhancements are requests. The most important one, if I had to choose would be either an override, or obey existing. Either of those two options. Yes, that might result in instances where the system didn't join (duplicates), but that could be reflected in the documentation as a real genuine risk.

Contributor guide

Open the contributing guide

Research direction

Read agent/plugins/domainjoin/domainjoin_unix_script.go at the linked hostname-setting function, then trace how REGION and the current hostname are obtained. Before implementation, clarify which override sources and fallback behavior are in scope; done should cover the agreed hostname selection behavior and the documented duplicate-name risk.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
cloud, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.