Problem scenario
You do not want to manipulate a variable using a shell: or command: key word. You want a variable to be changed based on conditional logic. What do you do?
Solution
Use "set_fact:" and "when:"
Here is an example:
set_fact:
vara: False
when: "{{ foobar }}" == 35