I have a playbook that is applied to various inventories. Some of the plays do not apply to all inventories.
I can leave the group out of an inventory, or I can add it but leave it empty. In both cases, this yields a warning when the optional play is run:
[WARNING]: Could not match supplied host pattern, ignoring: myoptionalgroup
I still want to use this class of warning to generate a report to catch mistakes - e.g. where a group name has been mistyped in the play or inventory, but I do not want it to appear when I know it is deliberate.
How can I best suppress the warning in those situations where I know that there will be no hosts to which a play applies in a given inventory?