redhat-cop / redhat-cop/ocp4-helpernode

Improve validate_host_names.yaml

Open
#276 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Jinja
Stars
358
Forks
308
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tasks/validate_host_names.yaml and vars/main.yml, comparing the current CHARS and when expression with the requested ValidHostnameRegex and search condition. Done means host validation is clearer and also covers IP addresses; confirm whether MAC validation and the validate.yaml split are in scope before changing them.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.