Ensure ansible-config properly validates all entries - #84921
Conversation
| display.error(f"Found unknown key '{k}' in section '{s}' in '{C.CONFIG_FILE}.") | ||
| found = True | ||
|
|
||
| # Validate only the required key for galaxy servers |
There was a problem hiding this comment.
Please create a changelog fragment. See this fragment as an example.
There was a problem hiding this comment.
Also, write an integration test for this change. Thanks.
There was a problem hiding this comment.
is the url required? iirc the server entry itself could be a url/ip
There was a problem hiding this comment.
also, not the correct approach, the config definitions tell you which field is required or not, hardcoding the fields is not what we want to do.
There was a problem hiding this comment.
the other part is checking type, if the fields are defined
There was a problem hiding this comment.
Got it! I'm currently updating the validation logic based on your feedback. I'll push the changes shortly.
Thanks
…dded changelog and integration test
|
Hi, Just checking in to see if there's any update on this PR. Happy to make any changes if needed! |
SUMMARY
This PR improves the validation mechanism in
ansible-configto correctly handle dynamic 'galaxy server' entries. Previously, configurations missing mandatory fields, such as the 'url' in galaxy server definitions, were not flagged as errors. This fix ensures that such missing fields are properly detected and reported during validation.Fixes #84843
ISSUE TYPE