LXD Grouping of Remotes / Containers

I’m managing nearly two dozen remote hosts from a single LXD control host, and on each remote host I have a few different containers.

As I’m adding remotes, I manage them for example by using lxc start <remote_foo>:<container_bar> <remote_foo2>:<container_bar2> <remote_foo3>:<container_bar3> in the same command, and this works great, however things start to get unwieldy after so many remotes.

I’m curious how folks are managing large numbers of remote hosts using a single “controller container” and the various containers on those hosts.

I think it could be useful if I could group various remote hosts so that I could, for example, start or stop all containers named container_bar in a group of remote hosts, or stop all containers in a subsection of my remote hosts, or stop all containers with profile_foo across all remotes or a group therein.

This might be out of scope of the LXD API, but I’m curious how others have managed this. Right now I’m using an Ansible playbook to manage the LXD command line on the control host but this requires that I manually account for my remote hosts in an inventory file, which itself will become unwieldy once I’ve got multiple dozens of remote hosts and multiple containers therein. I’d love to find a way to do all this from LXD itself without needing Ansible or another script to loop over a list of remote hosts.