title: Run task only if host does not belong to a group
body: <p>I'd like to able to run an ansible task only if the host of the current playbook <strong>does not belong</strong> to a certain group. In semi pseudo code:</p>
  
  <pre><code>- name: my command
    command: echo stuff
    when: "if {{ ansible_hostname }} not in {{ ansible_current_groups }}"
  </code></pre>
  
  <p>How should I do this?</p>