First, that's a really old version of ansible, and you need to upgrade.
Second, the "when" clause uses jinja syntax and it's complaining that
it can't evaluate your syntax: it's a syntax error, not a fact error.
In jinja, the "not" needs to come before the expression it's negating.
Try something like this: