title: Issue with Ansible ternary filter
body: <p>I assume I'm doing something wrong here, but it would be helpful if someone could at least point me in the right direction. I have the following task:</p>
  
  <pre><code>- name: Set up users
    user: name={{ item.username }}
          groups={{ item.groups|join(',') }}
          comment={{ item.full_name }}
          shell=/bin/bash
    with_items: "{{ (extra_users is defined) | ternary(users + extra_users, users) }}"
  </code></pre>
  
  <p>The list <code>extra_users</code> is only sometimes defined, and when it isn't, the task fails with the error <code>"'extra_users' is undefined"</code>, which I thought the ternary would guard against. What's going wrong?</p>