Accessing server inventory list while deploying to clients

I have a playbook that configures multiple client machines.

Each client needs to be configured with a unique server IP address from the servers in a cluster.

The mapping from client to server is one-to-one, all the hosts are running in ec2, and the inventory is dynamic.

Is there a way that I can get the list of servers from the inventory as a list variable, and iterate over the the list as ansible configures each client?

the groups variable is a dictionary with the groups in which the keys
are the list of servers that are part of it, so for example
groups['all'] has a list of all the servers, you just need groups[<my
server group>]