Using python to directly interact with LXD and Ansible.
Using ansible to create and backup containers is kind of a shitpile (which is weird because the debian installable pylxd interface looks really good). Some of the side effects of our attempts to use ansible to back up our containers included snapshots (which had to be manually culled) running at the same ip as the production servers.
For this reason I plan to directly run container creation backup and migration from python (v3). Python scripts should reference the same datasource for which servers are which. My original foray into ansibles internal and poorly documented api felt about as painfull as the ansible itself. I replaced it with ansible_runner.
These modules are intended to be usefull standalone or as part of a maintainance routine.
According to LXD server kb2018
According to LXD server bs2020