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
I expect this PR to be a bit controversal, but I think its one that we should give some thought / discussion.
Through the various workshops, we have multiple sections of code which utilize what I would call "Fail by Design" tasks. This is any task where we always expect the result to fail the first time the provisioner is ran. While using "block and rescue" to implement these tasks can be elegant, I think it is really misusing its original purpose and instead we are using it as a logic gate. It also leaves us with a nasty side effect, all the Angry Red Failure notices on every run of the provisioner. I know for myself, every change I make, I have to scroll back through all the failures and make sure they were all skipped and not ones caused by my change. I can't imagine what someone who runs this provisioner for the first time thinks.
What I propose instead, is taking any task that we expect to fail, and adding an actual check to the failed_when that excludes the statuses we know we will get when running it (to allow to actually fail if something else is completely wrong) or add a "failed_when: false" to it to stop the Angry Red Text. If it used a block / rescue, we would instead use blocks for the "rescue" tasks with a when statement that checks for the actual results we wanted (like status being 201, or the cert being present, etc...)
We would leave any block / rescue that are not "Fail by Design". We would also leave any tasks that we expect to fail but has "retries" set or an "until".
This PR removes all the failures you get when running the Windows workshop. I will have to do a few more commits to resolve any from the other workshops, but wanted to discuss this topic before putting in the effort.
"Failed by Design" Fixes
"Fails on rerun because we are blindly executing awx-cli"
ISSUE TYPE
COMPONENT NAME