Skip to content
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

Consistently replace '_' with '-' in hostnames #1619

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

jbemmel
Copy link
Collaborator

@jbemmel jbemmel commented Dec 7, 2024

It is not a valid FQDN character, and some platforms (like Cumulus NVUE) fail with an error

We could consider restricting node names to be valid FQDNs (of at most 16 characters), and/or apply the 'replace' normalization in Python rather than all templates (either define a node.hostname property and use that everywhere instead of inventory_hostname, or change inventory_hostname (and issue an error when troublesome node names are used)

It is not a valid FQDN character, and some platforms (like Cumulus NVUE) fail with an error

We could consider restricting node names to be valid FQDNs of at most 16 characters, and apply the 'replace' normalization in Python rather than all templates
Copy link
Owner

@ipspace ipspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for such a change. Many platforms accept both.

Whichever platform cannot deal with a valid node identifier should solve its own issues in a configuration template.

Also:

  • Did you test all these changes? Are you sure they work?
  • Why did you not change the hostname mappings if you want to enforce consistency?

Just because you have a problem with NVUE does not mean everything else has to change. Submit a PR for those platforms that cannot handle '_' and I'll merge it.

@jbemmel
Copy link
Collaborator Author

jbemmel commented Dec 9, 2024

There is no need for such a change. Many platforms accept both.

Whichever platform cannot deal with a valid node identifier should solve its own issues in a configuration template.

Also:

  • Did you test all these changes? Are you sure they work?
  • Why did you not change the hostname mappings if you want to enforce consistency?

Just because you have a problem with NVUE does not mean everything else has to change. Submit a PR for those platforms that cannot handle '_' and I'll merge it.

Many platforms accept both, Ubuntu for example simply ignores the '_' characters and a r_1 hostname becomes r1.

Most of the platforms I have access to - eos, cumulus, dell os10, linux - use the character substitution. The immediate issue was with Cumulus NVUE, but - for example - Cisco AVA is reported to have similar issues.

I think users would be better off if they stayed away from using '_' in hostnames, lacking that the next best thing is - imho - to replace '_' with '-', rather than let it be ignored and hope it doesn't cause issues. We could make that configurable, while I did not test the other platforms I think it is reasonable to expect the hostname to work at least as well with a '-', and possibly better.

I can submit a PR for only Cumulus NVUE, I do not have access to most other platforms so I don't really care for myself. But I thought it'd be nice for the community

@ipspace
Copy link
Owner

ipspace commented Dec 9, 2024

I can submit a PR for only Cumulus NVUE

You should have done that in the first place.

I do not have access to most other platforms so I don't really care for myself.

Copiously illustrated in #1623.

Also: stop "fixing" stuff you don't care about and have no intention of testing.

But I thought it'd be nice for the community

Maybe it's just me, but in my personal opinion the community might appreciate a tested and working software more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants