Problem scenario
You run an Ansible playbook that uses a variable, but you get the message “fatal: FAILED! ={“msg”: “The conditional check …The error was: error while evaluating conditional (ansible_hostname == ):”. What should you do?
Solution
When testing a variable’s value to another fixed string, put quotes around the string.
Here is an incorrect example of a playbook using such a comparison:
…