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

33 lines
933 B
Text
Raw Normal View History

2022-03-08 19:42:28 +01:00
[Files]
Volatile=true
PrivateUsersChown=false
2023-06-23 08:12:05 +02:00
{% 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 %}
2022-03-08 19:42:28 +01:00
[Network]
Private=yes
VirtualEthernet=yes
2023-06-23 08:12:05 +02:00
{% 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 %}