-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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
validate_argument_spec - fix validating the argument spec before using it to validate vars #79657
base: devel
Are you sure you want to change the base?
validate_argument_spec - fix validating the argument spec before using it to validate vars #79657
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
9bac965
to
2b8745f
Compare
) | ||
for block in validation_blocks: | ||
for task in block.block: | ||
task.implicit = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't change how the validation task is displayed by default. Callbacks only ignore implicit Tasks (unless they set the attr wants_implicit_tasks
), and always get the TaskResults, even from implicit Tasks. https://github.com/ansible/ansible/blob/devel/lib/ansible/executor/task_queue_manager.py#L442-L443
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs portion LGTM
changelogs/fragments/79657-warn-for-unsupported-role-arg-spec-fields.yml
Outdated
Show resolved
Hide resolved
fbccb19
to
000cf1d
Compare
35b6180
to
b633223
Compare
7e92a4c
to
a5df33a
Compare
a5df33a
to
bbeb55c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
passing it to the ArgumentSpecValidator to prevent unhandled errors during variable validation. Make role argument spec errors non-fatal at runtime. Display a warning and include details with -vvv. Pass ArgumentSpecValidator a pruned argument spec containing the valid portion. Give an error and return argument_spec_errors in the task result for non-implicit validate_argument_spec tasks. Add tests for role argument spec errors and validate_argument_spec argument_spec errors.
bbeb55c
to
4ba445b
Compare
SUMMARY
add a spec for the spec
This resolves the error in #79624, but replaces it with a warning because
no_log
in the role's argument spec has no bearing on whether or not the tasks in the role divulge it. The role currently needs to manage things likeno_log
/aliases
for variables itself.Fixes #79624
ISSUE TYPE
COMPONENT NAME
validate_argument_spec