Commit 2a8fb1e4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0354a097
......@@ -28,7 +28,7 @@ md5sum = 07e6e578c88062a15d9bb4ceae27d5fa
[ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum = 0d6552b13d87f89f8e5df0d4821ae3c8
md5sum = 63701da67c30199ec7b7b2743b7cdfe4
[ru_sdr_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg
......@@ -88,7 +88,7 @@ md5sum = 4855e1b8dbc6fee88a16cefc39e96693
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 1fb7bb19dc2a5aee2494253d83d35273
md5sum = cfd86f44a21903aed6d86abaf1bf3163
[template-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
......@@ -145,7 +145,7 @@ md5sum = f167b4be5e327b276b42267e0678f577
[dnsmasq-enb.jinja2.cfg]
filename = config/dnsmasq-enb.jinja2.cfg
md5sum = e2b415046926d9a9ef542816dd86eefb
md5sum = fa3598d521ba603960eeeef190be788d
[ims.jinja2.cfg]
filename = config/ims.jinja2.cfg
......
{%- for (ru_ref, iru) in iru_dict|dictsort | selectattr('1._.cpri_link', 'defined') %}
{%- set ru = iru['_'] %}
{%- set ru_tap = ru.cpri_link._tap %}
{%- set vtap = json_module.loads(vtap_jdict[ru_tap]) %}
# {{ ru_ref }} @ {{ ru_tap }}
dhcp-leasefile={{ directory['etc'] }}/dnsmasq.leases
......
......@@ -147,7 +147,7 @@ context =
import json_module json
import netaddr netaddr
section directory directory
section vtap vtap
section vtap_jdict vtap_jdict
json iru_dict {{ rulib.iru_dict | tojson }}
[dnsmasq-service]
......
......@@ -55,6 +55,7 @@ config-testing = {{ slapparameter_dict.get("testing", False) }}
{#- split slapos tap interface for each RU that needs its own tap.
fallback to non-split approach for ntap <= 1 to avoid hard-dependecy on setcap/tapsplit #}
{%- set ntap = len(list(iru_dict|dictsort | selectattr('1._.cpri_link', 'defined'))) %}
{%- set vtap_list = [] %}
[vtap]
recipe = plone.recipe.command
ntap = {{ ntap }}
......@@ -68,6 +69,7 @@ ntap = 0
stop-on-error = false
{%- if ntap == 1 %}
{%- do vtap_list.append('{{ slaplte.tap }}') %}
[vtap.{{ slaplte.tap }}]
network = {{ slap_configuration['tap-ipv6-network'] }}
gateway = {{ slap_configuration['tap-ipv6-gateway'] }}
......@@ -78,8 +80,9 @@ addr = {{ slap_configuration['tap-ipv6-addr'] }}
{%- for i in range(1,ntap+1) %}
{%- set tap = '%s-%d' % (slaplte.tap, i) %}
{%- do vtap_list.append(tap) %}
[vtap.{{ tap }}]
recipt = slapos.recipe.build
recipe = slapos.recipe.build
init =
tapsplit = __import__('{{ ru_tapsplit }}')
net = tapsplit.ifnet6('{{ tap }}')
......@@ -91,6 +94,19 @@ init =
{%- endif %}
# vtap_jdict maps tapname -> json(interface-info)
[vtap_jdict]
recipe = slapos.recipe.build
depends = {% for tap in vtap_list %} ${vtap.{{tap}}:recipe} {% endfor %}
init =
import json
{%- for tap in vtap_list %}
tap = self.buildout['vtap.{{tap}}']
tap = {k: tap[k] for k in ('network', 'gateway', 'addr')}
options['{{tap}}'] = json.dumps(tap)
{%- endfor %}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment