Run once on multiple Inventory Hosts with same ansible_host value

I am importing my inventory from ServiceNow, so I have to go with what I’m given. I’m given multiple WebLogic Nodes per individual server, that is per ansible_host. I’d like the user to be able to pull all Inventory Hosts, but have the process run once per “ansible_host” sometimes and other times have the process run against each Inventory Host separately, so multiple times per ansible_host.

Is this possible without writing a “lock file” solution?

Thank you.

No need for lockfiles, I would use groups instead. Setup a group that
has one instance of inventory_hostname per ansible_host, then target
that group when you want to do 'single operation per real host'. for
'all' just use the all group.

Lovely idea! Thank you!

Kevin