title: How to run an ansible playbook only if a group exists?
body: <p>I wonder if anyone found a solution that would avoid displaying any warnings if an inventory group is undefined or empty.</p>
  
  <p>I just want to make a section of the playbook run <em>if a group exists and is not empty</em>, <strong>skipping without warnings</strong> if not.</p>
  
  <p>Please read <a href="https://github.com/ansible/ansible/issues/35255#issuecomment-388455001" rel="nofollow noreferrer">https://github.com/ansible/ansible/issues/35255#issuecomment-388455001</a> and test alternatives because I spend a good amount of time trying to find a workaround for this issue.</p>
  
  <p>So far I was not able to find any way to avoid the warnings when group is not defined.</p>