# Radical RFE: ansible should differentiate between constants and variables

**URL:** <https://forum.ansible.com/t/radical-rfe-ansible-should-differentiate-between-constants-and-variables/17004>\
**Category:** Ansible Project\
**Created:** [December 9, 2014, 10:51pm UTC](https://forum.ansible.com/t/radical-rfe-ansible-should-differentiate-between-constants-and-variables/17004 "2014-12-09T22:51:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Irvine](https://avatars.discourse-cdn.com/v4/letter/n/5f9b8f/32.png) [@Nick\_Irvine](https://forum.ansible.com/u/Nick_Irvine)\
**Post date:** [December 9, 2014, 10:51pm UTC](https://forum.ansible.com/t/radical-rfe-ansible-should-differentiate-between-constants-and-variables/17004/1 "2014-12-09T22:51:47Z")

</div>

By constant, I mean all variables that can be computed prior to any tasks being run and will not change, like inventory\_hostname. Variables are therefore things that may change due to a task being executed.

The idea is that any “when” clause that contains only constants can also be evaluated prior to any tasks being executed, and thereby potentially excluded. Right now, the --list-tasks flag is rather silly: it prints tasks that are conditionally skipped. Yes, there’s the --check flag, but it has its own problems (not supported by all modules).

It also means if somehow no tasks are going to be run on host X, we can essentially exclude it, skipping gathering tasks.

Right now, I work around the problem by including a human-friendly description of the when condition in the task name, but this obviously sucks.

Stupid? Impossible?

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [December 9, 2014, 11:12pm UTC](https://forum.ansible.com/t/radical-rfe-ansible-should-differentiate-between-constants-and-variables/17004/2 "2014-12-09T23:12:26Z")

</div>

This is probably better as an idea to discuss on the devel mailing list:

[https://groups.google.com/forum/#!forum/ansible-devel](https://groups.google.com/forum/#!forum/ansible-devel)

-Toshio
