<p dir="auto">My original task looked like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  - name: &quot;Check Ansible version&quot;
    run_once: true
    debug: msg=&quot;You need at least version 2.0.0.0, currently using version {{ ansible_version.full }}&quot;
    failed_when: &quot;{{ ansible_version.full | version_compare('2.0.0.0', operator='lt', strict=False)}}&quot;"><pre class="notranslate"><code class="notranslate">  - name: "Check Ansible version"
    run_once: true
    debug: msg="You need at least version 2.0.0.0, currently using version {{ ansible_version.full }}"
    failed_when: "{{ ansible_version.full | version_compare('2.0.0.0', operator='lt', strict=False)}}"
</code></pre></div>
<p dir="auto">and that results in <code class="notranslate">The conditional check '{{ ansible_version.full|version_compare(\"2.0.0.0\" ' failed. The error was: template error while templating string: unexpected end of template, expected ','.. String: {{ ansible_version.full|version_compare(\"2.0.0.0\" "}</code></p>
<p dir="auto">Following advise from Brian in the forum I changed the condition to <code class="notranslate">failed_when: ansible_version.full | version_compare('2.0.0.0', operator='lt', strict=False)</code> which then throws a different error <code class="notranslate">The error was: template error while templating string: unexpected '}', expected ')'. String: {% if ansible_version.full|version_compare('2.0.0.0' %} True {% else %} False {% endif %}"}</code></p>
<p dir="auto">Looks like a bug to me, isn't it?</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.0.2.0
  config file = /home/sfox/.ansible.cfg
  configured module search path = /home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/library"><pre class="notranslate"><code class="notranslate">ansible 2.0.2.0
  config file = /home/sfox/.ansible.cfg
  configured module search path = /home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/library
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="library = /home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/library
forks          = 20
sudo_flags = -H -i
jinja2_extensions = jinja2.ext.do,jinja2.ext.i18n,jinja2.ext.loopcontrols,jinja2.ext.with_
ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
action_plugins     = /usr/share/ansible_plugins/action_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/action
callback_plugins   = /usr/share/ansible_plugins/callback_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/callback
connection_plugins = /usr/share/ansible_plugins/connection_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/connection
lookup_plugins     = /usr/share/ansible_plugins/lookup_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/lookup
vars_plugins       = /usr/share/ansible_plugins/vars_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/vars
filter_plugins     = /usr/share/ansible_plugins/filter_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/filter
nocows = 1"><pre class="notranslate"><code class="notranslate">library = /home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/library
forks          = 20
sudo_flags = -H -i
jinja2_extensions = jinja2.ext.do,jinja2.ext.i18n,jinja2.ext.loopcontrols,jinja2.ext.with_
ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
action_plugins     = /usr/share/ansible_plugins/action_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/action
callback_plugins   = /usr/share/ansible_plugins/callback_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/callback
connection_plugins = /usr/share/ansible_plugins/connection_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/connection
lookup_plugins     = /usr/share/ansible_plugins/lookup_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/lookup
vars_plugins       = /usr/share/ansible_plugins/vars_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/vars
filter_plugins     = /usr/share/ansible_plugins/filter_plugins:/home/sfox/src/sysops/ops/branches/ansible-2.0/ansible/plugins/filter
nocows = 1
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">From: Fedora 23<br>
Managing: Ubuntu Trusty (14.04)</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">I can no longer specify lists or tuples in a failed_when statement like I could with 1.9.x</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Using this inventory file</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test_host ansible_host=10.0.0.208"><pre class="notranslate"><code class="notranslate">test_host ansible_host=10.0.0.208
</code></pre></div>
<p dir="auto">and this playbook</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: My Playbook
  hosts: test_host
  gather_facts: no

  tasks:  
    - shell: ls pants                         
      register: result
      failed_when: result.rc not in [0, 1]
      #failed_when: &quot;result.rc not in [0, 1]&quot;           
      #failed_when: result.rc not in (0, 1)"><pre class="notranslate"><code class="notranslate">- name: My Playbook
  hosts: test_host
  gather_facts: no

  tasks:  
    - shell: ls pants                         
      register: result
      failed_when: result.rc not in [0, 1]
      #failed_when: "result.rc not in [0, 1]"           
      #failed_when: result.rc not in (0, 1)
</code></pre></div>
<p dir="auto">I cannot get Ansible to execute this with or without quotes. Both lists and tuples worked previously.</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [My Playbook] ************************************************************ 

TASK: [shell ls pants] ******************************************************** 
failed: [test_host] =&gt; {&quot;changed&quot;: true, &quot;cmd&quot;: &quot;ls pants&quot;, &quot;delta&quot;: &quot;0:00:00.003004&quot;, &quot;end&quot;: &quot;2016-04-05 16:29:21.478688&quot;, &quot;failed&quot;: true, &quot;failed_when_result&quot;: true, &quot;rc&quot;: 2, &quot;start&quot;: &quot;2016-04-05 16:29:21.475684&quot;, &quot;stdout_lines&quot;: [], &quot;warnings&quot;: []}
stderr: ls: cannot access pants: No such file or directory

FATAL: all hosts have already failed -- aborting"><pre class="notranslate"><code class="notranslate">PLAY [My Playbook] ************************************************************ 

TASK: [shell ls pants] ******************************************************** 
failed: [test_host] =&gt; {"changed": true, "cmd": "ls pants", "delta": "0:00:00.003004", "end": "2016-04-05 16:29:21.478688", "failed": true, "failed_when_result": true, "rc": 2, "start": "2016-04-05 16:29:21.475684", "stdout_lines": [], "warnings": []}
stderr: ls: cannot access pants: No such file or directory

FATAL: all hosts have already failed -- aborting
</code></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [My Playbook] *************************************************************

TASK [command] *****************************************************************
fatal: [test_host]: FAILED! =&gt; {&quot;failed&quot;: true, &quot;msg&quot;: &quot;The conditional check 'result.rc not in [0' failed. The error was: template error while templating string: unexpected '}', expected ']'. String: {% if result.rc not in [0 %} True {% else %} False {% endif %}&quot;}

NO MORE HOSTS LEFT *************************************************************"><pre class="notranslate"><code class="notranslate">PLAY [My Playbook] *************************************************************

TASK [command] *****************************************************************
fatal: [test_host]: FAILED! =&gt; {"failed": true, "msg": "The conditional check 'result.rc not in [0' failed. The error was: template error while templating string: unexpected '}', expected ']'. String: {% if result.rc not in [0 %} True {% else %} False {% endif %}"}

NO MORE HOSTS LEFT *************************************************************
</code></pre></div>