-
Notifications
You must be signed in to change notification settings - Fork 2
Description
The action plugins (for example delete_settings, setup and upgrade) will always execute as normal, even when check-mode (-C) is enabled. This can lead to unintentionally applying potentially destructive changes.
The ActionBase class has some built-in functionality for no-check-mode-support since at least Ansible v2.8, with some changes in v2.16 . You only need to set the _supports_check_mode class attribute to False (unfortunately is True by default), and call the ActionBase.run() method from the implementations run() method. This will automatically skip the task if check-mode is enabled.
Should the action plugin support check mode fully or partially, this can/needs to be checked in the implementations run() method, and acted upon appropriately.
Ideally all modules should be screened as well whether a) to what extend they support check-mode, and b) if they actually report/act accordingly.