I have a task that I would like to conditionally run even in check_mode (actually I want to set it for an entire role, but I’m seeing the same behavior in regular tasks).
The idea is that this would NOT run the task:
ansible-playbook always_run.yml --check
``
And then to actually execute the task in check_mode:
ansible-playbook always_run.yml -e '{"runit":true}' --check
``
But that's not the behavior I'm seeing. The problem is that alwasy_run always evaluates to 'true'.
Playbook (I’ve tried a few different variations. The only one that properly evaluates always_run is always_run: false):
`