I know "all" doesn't match the implicit localhost; the title succinctly expresses my question.
Motivation: I have a playbook that needs to be run on cloud hosts generated dynamically and added to groups with
add_host during a playbook, but I also need to run the whole playbook on a vagrant vm, as well as in CI (molecule), so I want to use "all" for the latter two cases, so that when I specify inventory, certain plays will target the inventoried hosts. These plays will also have the names of the add_host groups, so that I don't have to duplicate plays. I'm just wondering if I can write
hosts: all # instead of
for these plays, and have the
add_host hosts included, without specifying their names. I will only specify inventory for the vagrant and molecule scenarios, and not for the live cloud deployment scenario, so that I don't target my entire cloud infrastructure.