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

Improve validate_host_names.yaml #276

Open
christianh814 opened this issue Feb 10, 2022 · 0 comments
Open

Improve validate_host_names.yaml #276

christianh814 opened this issue Feb 10, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@christianh814
Copy link
Contributor

We should improve validate_host_names.yaml by making it clearer to match the regex for a valid internet host and then fail.

  • Change CHARS to ValidHostnameRegex = "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$"
  • Change the "when" to item is search('{{ ValidHostnameRegex }}')
  • Add IP address validation (based on this stackoverflow)

Another thing that can be done is validate the Mac Address as well

We should also probably change the name of validate_host_names.yaml to validate.yaml for generic validations. We could also break them up into individual files. I'm open for suggestions on that front.

@christianh814 christianh814 added enhancement New feature or request help wanted Extra attention is needed labels Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant