(2) Be able to execute commands within a container using “lxc exec ” - so you don’t have to set up an ssh trust relationship with the container. Something like “ansible_connection=lxd” in the inventory.
This could be done by shelling out to the “lxc xxx” commands (confusingly prefixed lxc not lxd). Alternatively, lxd also has a proper API you can talk to, with a python client too. https://linuxcontainers.org/lxd/rest-api/
Using the CLI you can control remote hosts using “:” as the container name. Using the REST API you connect directly to the host of interest.
Is there any work going on in this area? All I’ve been able to find is an ansible module for installing lxd itself on your host platform.
Looking at the code/features: this looks like a good starting point. It is missing the ability to create or update a profile (idempotently) which is something I’ll need.