Commit cd05ce47 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

software/ors-amarisoft: render ue-db.cfg inside core-network buildout

parent 26defa86
......@@ -16,7 +16,7 @@
[template]
filename = instance.cfg
md5sum = f23909a703ac9001afec38cbac19591a
md5sum = 9b7ced53c256fa5b60c679c75ed03727
[amarisoft-stats.jinja2.py]
_update_hash_filename_ = amarisoft-stats.jinja2.py
......@@ -64,7 +64,7 @@ md5sum = 2d7558e4799818a5546850f735fbb399
[template-core-network]
_update_hash_filename_ = instance-core-network.jinja2.cfg
md5sum = aa7fcf7f68ced7e880158d0aa3307be4
md5sum = ed92a5762932220e0337d6c254f18024
[template-ue-lte]
_update_hash_filename_ = instance-ue-lte.jinja2.cfg
......@@ -80,7 +80,7 @@ md5sum = c5f581ba01654b2aec46000abf8d0e35
[ue_db.jinja2.cfg]
filename = config/ue_db.jinja2.cfg
md5sum = dcaac06553a3222b14c0013a13f4a149
md5sum = d5afe12aa3e2e93d30455da51540cfdb
[enb.jinja2.cfg]
filename = config/enb.jinja2.cfg
......
{%- set filtered_slave_instance_list = [] %}
{%- for slave_instance in slave_instance_list %}
{%- if slave_instance.get('_', '') != '' %}
{%- set slave = json_module.loads(slave_instance.pop('_')) %}
{%- else %}
{%- set slave = slave_instance %}
{%- endif %}
{%- if slave.get('imsi', '') != '' %}
{%- do filtered_slave_instance_list.append(slave) %}
{%- endif %}
{%- endfor -%}
ue_db: [
{%- for i, slave in enumerate(filtered_slave_instance_list) %}
{%- for i, slave in enumerate(slap_configuration['sim_list']) %}
{%- if i == 0 -%}
{
{%- else -%}
......
......@@ -69,7 +69,8 @@ cert = {{ slap_connection['cert-file'] }}
configuration.gtp_addr = 127.0.1.100
configuration.ims_addr = 127.0.0.1
configuration.ims_bind = 127.0.0.2
ue_db_path = {{ ue_db_path }}
ue_db_path = ${ue-db-config:output}
sim_list = {{ dumps(sim_slave_instance_list) }}
[monitor-httpd-conf-parameter]
httpd-include-file = {{ buildout_directory }}/etc/httpd-include-file.conf
......@@ -116,7 +117,7 @@ mode = 0775
pidfile = ${directory:run}/ims.pid
hash-files =
${ims-config:output}
{{ ue_db_path }}
${ue-db-config:output}
environment = AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[mme-sh-wrapper]
......@@ -144,7 +145,7 @@ mode = 0775
pidfile = ${directory:run}/mme.pid
hash-files =
${mme-config:output}
{{ ue_db_path }}
${ue-db-config:output}
${mme-sh-wrapper:output}
environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib:{{ nghttp2_location }}/lib
......@@ -193,6 +194,16 @@ context =
url = {{ ims_template }}
output = ${directory:etc}/ims.cfg
[ue-db-config]
recipe = slapos.recipe.template:jinja2
url = {{ ue_db_template }}
filename = ue_db.cfg
extensions = jinja2.ext.do
output = ${directory:etc}/${:filename}
context =
import json_module json
section slap_configuration slap-configuration
[mme-config]
<= config-base
{% if slapparameter_dict.get("mme_config_link", None) %}
......
......@@ -328,11 +328,11 @@ extra-context =
raw mme_template ${mme.jinja2.cfg:target}
raw dnsmasq_template ${dnsmasq.jinja2.cfg:target}
raw ims_template ${ims.jinja2.cfg:target}
raw ue_db_template ${ue_db.jinja2.cfg:target}
raw openssl_location ${openssl:location}
raw nghttp2_location ${nghttp2:location}
raw iperf3_location ${iperf3:location}
raw dnsmasq_location ${dnsmasq:location}
key ue_db_path ue-db-config:output
key dnsmasq_config_path dnsmasq-config:output
key slave_instance_list slap-configuration:slave-instance-list
......@@ -370,16 +370,6 @@ extra-context =
raw default_nr_imsi ${default-params:default-nr-imsi}
raw default_nr_k ${default-params:default-nr-k}
[ue-db-config]
recipe = slapos.recipe.template:jinja2
url = ${ue_db.jinja2.cfg:target}
filename = ue_db.cfg
extensions = jinja2.ext.do
output = $${directory:etc}/$${:filename}
context =
import json_module json
key slave_instance_list slap-configuration:slave-instance-list
[dnsmasq-config]
recipe = slapos.recipe.template:jinja2
url = ${dnsmasq.jinja2.cfg:target}
......
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