Improve bigboot role when called in check mode #78
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.
It would be nice to be able to use the bigboot role in check mode so that we can determine whether any changes would be made when it is called.
By default, calling the role in check mode fails with the following:
To replicate this error, setup an inventory file with approriate access to a host and run:
ansible all -m include_role -a "name=infra.lvm_snapshots.bigboot" -C
When running in check mode, the "Get default kernel" task does not run.
The
ansible.builtin.command
could legitimately run commands that change the server so skipping them in check mode is a sensible default.The pull request adds
check_mode: false
to those tasks which should be considered safe to run and adds a conditional check on the final validation task, since we expect this to fail if changes are not made.Sample output when run in check mode and no changes are required:
Sample output when run in check mode and changes are required: