Summary
In tasks, I can add check_mode: false so that the task is executed with check mode disabled, even if the user explicitly requested check mode. This is very useful when for example using ansible.builtin.command to execute something that doesn't modify state, and the result of that call is needed for further tasks.
I'm wondering how to do that in an action plugin, where I execute a module (like ansible.builtin.command) that doesn't support check mode, but where I know that for the specific set of module args it does not modify state.
The only workaround I found was to temporarily set self._task.check_mode to False. Is this the recommended way, or is there a better way to achieve this?
Issue Type
Feature Idea
Component Name
action plugins
Additional Information
This can be very useful, for example when converting roles with quite complex logic into action plugins, which are much better suited for taking care of complex logic than roles.
Code of Conduct
Summary
In tasks, I can add
check_mode: falseso that the task is executed with check mode disabled, even if the user explicitly requested check mode. This is very useful when for example usingansible.builtin.commandto execute something that doesn't modify state, and the result of that call is needed for further tasks.I'm wondering how to do that in an action plugin, where I execute a module (like
ansible.builtin.command) that doesn't support check mode, but where I know that for the specific set of module args it does not modify state.The only workaround I found was to temporarily set
self._task.check_modetoFalse. Is this the recommended way, or is there a better way to achieve this?Issue Type
Feature Idea
Component Name
action plugins
Additional Information
This can be very useful, for example when converting roles with quite complex logic into action plugins, which are much better suited for taking care of complex logic than roles.
Code of Conduct