Option to make "No hosts matched" a FATAL error?

Hi all is there a way to make it so that “No hosts matched” becomes a FATAL error?

I’m using a CI job to kick off ansible to deploy something and in this case if it cannot find a host to deploy to, I want that to be a fatal error. Right now, ansible returns a zero exit code so the CI job succeeds and then people ask my why the job succeeded but the new code wasn’t deployed.

Marc

One stab at fixing this:

https://github.com/ansible/ansible/pull/11350

lets make this a configuration option, this used to be the case and
many people asked for it to change into a warning, as default
localhost entry meant you always have an inventory.

scratch that ... this is different, i was referring to empty
inventories, this is about plays not matching any host.