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.
Overall Review of Changes:
Other Windows roles for CIS have a post.yml section where handlers are flushed and Windows host is rebooted. Kept the same structure as sometimes, after Windows are applied, a reboot is expected and could prevent some other operations from working after this role has ran.
If windows reboot happen at the complete end of the playbook, it may prevent some other programs to install.
If windows reboot does not happen, then sysprep may fail to complete because of pending reboot being required.
Keeping the same structure accross the different roles seemed like the best thing to do.
Issue Fixes:
No issues, same as ansible-lockdown/Windows-2022-CIS#46
Enhancements:
Allow handlers to reboot host, or not.
How has this been tested?:
Yes, tested on different local Ansible executions.