Ansible playbook condition fails when variable has a default value
问题 Given the following playbook ( deployment.yml ): --- - name: Debug hosts: applicationservers tasks: - debug: msg="{{add_host_entries | default('false')}}" - debug: msg="{{add_host_entries | default('false') == 'true'}}" - debug: msg="Add host entries = {{add_host_entries | default('false') == 'true'}}" - include: add_host_entries.yml when: add_host_entries | default('false') == 'true' The condition to include add_host_entries.yml always fails, even if all of the above debug messages print