[WIP] Excluded certain include_role and include_tasks attributes from post_validate#75719
Draft
egmar wants to merge 5 commits into
Draft
[WIP] Excluded certain include_role and include_tasks attributes from post_validate#75719egmar wants to merge 5 commits into
include_role and include_tasks attributes from post_validate#75719egmar wants to merge 5 commits into
Conversation
Contributor
Author
…post_validate` `IncludeRole` and `IncludeTasks` attributes are exempt from `post_validate` based on value of `always_post_validate` property.
dcdb19c to
5d28832
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Fixes #75240.
This PR makes some of
IncludeRoleandIncludeTasksattributes to be exempt frompost_validatebased on value ofalways_post_validateproperty and aims to remove unnecessary template validation atinclude_roleorinclude_taskstask level (not their content). E.g.: when usinginclude_rolewith a role which has only one task, and ifremote_useris templated, then it should not be validated atinclude_rolelevel, but validated on the tasks inside the included role.I'm not fully sure this is a complete fix though, hence the WIP/Draft status, as I'm looking for feedback.
ISSUE TYPE
COMPONENT NAME
lib/ansible/playbook/base.py
lib/ansible/playbook/play_context.py
ADDITIONAL INFORMATION
Example playbook/role: https://github.com/egmar/include_role_example/blob/main/validate.yml
Before fix:
After fix: