Debugging conditionals
If your conditionalwhenstatement is not behaving as you intended, you can add adebugstatement to determine if the condition evaluates totrueorfalse. A common cause of unexpected behavior in conditionals is testing an integer as a string or a string as an integer. To debug a conditional statement, add the entire statement as thevar:value in adebugtask. Ansible then shows the test and how the statement evaluates. For example, here is a set of tasks and sample output: