2016-11-03 00:26:30 +01:00
|
|
|
lxc.utsname = {{ id }}
|
|
|
|
# Handled by lxc@.service
|
|
|
|
lxc.start.auto = 0
|
|
|
|
lxc.rootfs = /var/lib/lxc/{{ id }}/rootfs
|
|
|
|
lxc.rootfs.backend = dir
|
|
|
|
|
|
|
|
lxc.autodev = 1
|
|
|
|
lxc.kmsg = 0
|
|
|
|
|
2016-11-06 23:16:44 +01:00
|
|
|
{%- for net, conf in container['interfaces'].items() %}
|
|
|
|
lxc.network.type={{ conf['type'] }}
|
2016-11-03 00:26:30 +01:00
|
|
|
lxc.network.flags=up
|
2016-11-08 22:36:08 +01:00
|
|
|
{%- if conf['type'] == 'veth' %}
|
2016-11-06 02:49:56 +01:00
|
|
|
lxc.network.veth.pair={{ id }}-{{ net }}
|
|
|
|
{%- endif %}
|
|
|
|
{%- set inet_addr = pillar['hosts-inet'][net].get(id) %}
|
|
|
|
{%- if inet_addr %}
|
|
|
|
{%- set prefix_len = pillar['subnets-inet'][net].split('/')[1] %}
|
|
|
|
lxc.network.ipv4={{ inet_addr }}/{{ prefix_len }}
|
|
|
|
{%- endif %}
|
2016-11-06 23:16:44 +01:00
|
|
|
{%- if conf['type'] == 'veth' %}
|
2016-11-06 02:49:56 +01:00
|
|
|
lxc.network.link=br-{{ net }}
|
2016-11-08 22:36:08 +01:00
|
|
|
{%- elif conf['type'] == 'phys' %}
|
|
|
|
lxc.network.link=bond0.{{ pillar['vlans'].get(net) }}
|
2016-11-06 02:49:56 +01:00
|
|
|
{%- endif %}
|
|
|
|
lxc.network.name={{ net }}
|
2016-11-08 22:36:08 +01:00
|
|
|
{%- if net == 'core' %}
|
|
|
|
lxc.network.ipv4.gateway=172.20.72.1
|
|
|
|
{%- endif %}
|
2016-11-03 00:26:30 +01:00
|
|
|
#lxc.network.ipv6=
|
|
|
|
#lxc.network.ipv6.gateway=fe80::1
|
2016-11-06 02:49:56 +01:00
|
|
|
{%- endfor %}
|
2016-11-03 00:26:30 +01:00
|
|
|
|
|
|
|
## TODO: limits + caps
|
2016-11-08 22:36:08 +01:00
|
|
|
## TODO: include Debian.common.conf
|