Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

  1. {% if unprivileged %}
  2. # Distribution configuration (unprivileged)
  3. lxc.include = /usr/share/lxc/config/common.conf
  4. lxc.include = /usr/share/lxc/config/userns.conf
  5. lxc.arch = linux64
  6. {% if distro == 'debian' %}
  7. lxc.mount.entry = /sys/kernel/debug sys/kernel/debug none bind,optional 0 0
  8. lxc.mount.entry = /sys/kernel/security sys/kernel/security none bind,optional 0 0
  9. lxc.mount.entry = /sys/fs/pstore sys/fs/pstore none bind,optional 0 0
  10. lxc.mount.entry = mqueue dev/mqueue mqueue rw,relatime,create=dir,optional 0 0
  11. {% endif %}
  12. lxc.apparmor.profile = generated
  13. # Container specific configuration
  14. lxc.idmap = u 0 {{ subuidmap }}
  15. lxc.idmap = g 0 {{ subgidmap }}
  16. {% else %}
  17. # Distribution configuration (privileged)
  18. lxc.include = /usr/share/lxc/config/debian.common.conf
  19. lxc.apparmor.profile = generated
  20. lxc.apparmor.allow_nesting = 1
  21. lxc.tty.max = 4
  22. lxc.arch = amd64
  23. lxc.pty.max = 1024
  24. # Container specific configuration
  25. {% endif %}
  26. lxc.uts.name = {{ vm_name }}
  27. lxc.rootfs.path = lvm:/dev/{{ vg_name }}/vm_{{ vm_name }}
  28. # Network configuration
  29. lxc.net.0.type = veth
  30. lxc.net.0.flags = up
  31. lxc.net.0.link = br0
  32. lxc.net.0.name = eth0
  33. lxc.net.0.ipv4.address = {{ hostvars | ip_from_inventory(vm_name) }}/24
  34. lxc.net.0.ipv4.gateway = {{ hostvars | ip_from_inventory('vm_gateway') }}
  35. lxc.start.auto = {% if auto_start %}1{% else %}0{% endif %}