ansible/ansible — pull request #2980 by kilburn (2013-05-22 19:27:33+00:00)
Title: Document that derived variables' values are always strings, and may have to be casted when used in comparisons.

It is easy for users to misstep on this fact. For example, a user may write the following task that should not be executed when the distro's lsb version is lower than 5::

tasks:
- shell: echo "comparisons with derived may have to be casted"
when: ansible_lsb.major_version >= 5

This comparison doesn't produce an error, and appears to work if the test system should pass it. Actually, the comparison always passes because `ansible_lsb.major_version` evaluates to a non-empty string, and in python a non-empty string is always greater than a number.

This fact, along with an explanation of the right way to write the above task is introduced in the docs by this patch.