Is there a compliment to the always_run: true option for a play?
I have a need for a playbook to always run a single task in check_mode and use the results to do something.
I really don’t want to have to always run the playbook with --check (and use always_run: true for the other tasks) because if I forget to add that option, then I’ll accidentally run the task I don’t want to actually run.
there is a PR (not a feature yet) to set ansible_check_mode variable so you can figure out if you are in check mode or not and make your execution conditional on it.
That might be what I’m looking for, but I’m not sure.
I want to be able to run a playbook (not in check_mode), but tell one task to run only in check_mode.
Currently, if you run in check_mode, setting always_run: true on a task makes that task run as if it is not in check_mode. I want the opposite of this.