Skip to content

Action-Plugins don't respect Check-Mode #72

@m-hau

Description

@m-hau

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions