Add minimal support for diff to monitor plugin #34
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.
This change adds very minimal diff support for just the monitor plugin. It only does a diff based on the arguments passed in by the user and only supports only the "present" state.
To support a "full" diff, it would be necessary to make an additional network call to get the new monitor configuration from the instance. To avoid this, the code just diffs the changes passed in.
Please let me know if there's any changes you'd like me to make. I tested this on a local copy using the following playbook:
Putting this file at the repo root and running the following command should execute the playbook:
COLLECTIONS_PATHS="./:/usr/share/ansible/collections" ansible-playbook kuma-test-playbook.yml --diff
(you may have to adjust theCOLLECTIONS_PATH
setting to suit your environment.This should produce the following output (truncated to relevant parts):