Plugins

edi comes with a few reusable plugins:

LXC/LXD Templates

During the root file system assembly edi adds templates to the container image (see LXD Documentation).

The following templates are already predefined:

Hostname

This template dynamically adds the /etc/hostname file to the container.

Configuration Example
lxc_templates:
  ...
  100_etc_hostname:
    path: lxc_templates/debian/hostname/hostname.yml
  ...

Hosts

This template dynamically adds the /etc/hosts file to the container.

Configuration Example
lxc_templates:
  ...
  200_etc_hosts:
    path: lxc_templates/debian/hosts/hosts.yml
  ...

LXC/LXD Profiles

With the help of profiles a container configuration can be fine tuned in a modular way (see LXD Profile Documentation).

The following profiles have proven to be useful for various projects:

Default Network Interface

This profile adds a default network interface to the container named according to the value of edi_lxc_network_interface_name. The interface is of type bridged and its parent is lxdbr0.

Configuration Example
lxc_profiles:
  ...
  100_lxc_networking:
      path: lxc_profiles/general/lxc_networking/default_interface.yml
  ...

Default Root Device

This profile makes sure that the container uses the default storage pool as its root device. Please note that newer LXD versions (>=2.9) require the configuration of a storage pool.

Configuration Example
lxc_profiles:
  ...
  200_default_root_device:
    path: lxc_profiles/general/default_root_device/default_root_device.yml
  ...

Privileged Mode

This profile will make sure that the container is running in privileged mode.

Configuration Example
lxc_profiles:
  ...
  300_privileged:
    path: lxc_profiles/general/security/privileged.yml
  ...

Please note that if a container has one or more shared folders configured it will automatically be turned into privileged mode.

Ansible Playbooks