# setting 'always\_run' from a var

**URL:** <https://forum.ansible.com/t/setting-always-run-from-a-var/20756>\
**Category:** Ansible Project\
**Created:** [March 2, 2016, 11:57pm UTC](https://forum.ansible.com/t/setting-always-run-from-a-var/20756 "2016-03-02T23:57:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [March 2, 2016, 11:57pm UTC](https://forum.ansible.com/t/setting-always-run-from-a-var/20756/1 "2016-03-02T23:57:51Z")

</div>

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):

`
