Always use {{}} for variables, unless you have a conditional statement, such as "when: …". This is because conditional statements are run through Jinja, which resolves the expressions.
For example:
echo “This prints the value of {{foo}}”
when : foo is defined
Using brackets makes it simpler to distinguish between strings and undefined variables.
This also ensures that Ansible doesn't recognize the line as a dictionary declaration.