Lxd Operations¶
The LXD modules manage LXD containers
Facts used in these operations: lxd.LxdContainers.
lxd.container¶
Add/remove LXD containers.
lxd.container(id: 'str', present=True, image='ubuntu:16.04',
**kwargs,
)
Note: does not check if an existing container is based on the specified image.
id: name/identifier for the container
image: image to base the container on
present: whether the container should be present or absent
Example:
from pyinfra.operations import lxd
lxd.container(
name="Add an ubuntu container",
id="ubuntu19",
image="ubuntu:19.10",
)
Note
This operation also inherits all global arguments.
pyinfra 3.x