dataset/seed/host-systemd-machined/templates/nspawn

32 lines
933 B
Text

[Files]
Volatile=true
PrivateUsersChown=false
{% set name = rougail_variable|normalize_family %}
{% set container = machined['machine_' + name] %}
{% if container['srv_dir_' + name] %}
Bind={{ container['srv_dir_' + name] }}:/srv
{% endif %}
Bind={{ container['journal_dir_' + name] }}:/var/log/journal/
BindReadOnly={{ container['config_dir_' + name] }}:/usr/local/lib
{% if container['tls_dir_' + name] %}
Bind={{ container['tls_dir_' + name] }}:/srv/tls
{% endif %}
{% set zones = container['zones_' + name] %}
{% if zones %}
[Network]
Private=yes
VirtualEthernet=yes
{% for zone in zones %}
{% set index = loop.index - 1 %}
{% if index == 0 %}
Bridge={{ zones[0] }}
{% else %}
{% set intname = "vc-" + index|string + rougail_variable %}
VirtualEthernetExtra={{ intname[:15] }}:host{{ index }}
{% endif %}
{% endfor %}
{% endif %}
{% for port in container['incoming_ports_' + name] %}
Port=tcp:{{ port }}:{{ port }}
{% endfor %}