Commit b5b952fc authored by Joanne Hugé's avatar Joanne Hugé

wip: put amarisoft section in instance-amarisoft-base

parent b6c85c88
......@@ -78,6 +78,10 @@ md5sum = dab992c02a363e00cdc86f102a7ae489
_update_hash_filename_ = instance-ue.jinja2.cfg
md5sum = 0c387a13a57f7270595b74e11be8eb36
[template-amarisoft-base]
_update_hash_filename_ = instance-amarisoft-base.jinja2.cfg
md5sum = b116b58365600f12129d458750b57c71
[template-obsolete]
_update_hash_filename_ = instance-obsolete.jinja2.cfg
md5sum = c5f581ba01654b2aec46000abf8d0e35
......
......@@ -101,6 +101,8 @@ eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
{% include 'instance-amarisoft-base.jinja2.cfg' %}
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = {{ slap_connection['computer-id'] }}
......
......@@ -45,6 +45,8 @@ eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
{% include 'instance-amarisoft-base.jinja2.cfg' %}
{%- set icell_kind='enb' %}
{%- import 'slaplte.jinja2' as slaplte with context %}
{%- import 'ru_libinstance.jinja2.cfg' as rulib with context %}
......@@ -307,8 +309,8 @@ websocket-port = 443
websocket-password = ${websocket-password:passwd}
enb-ipv6 = {{ my_ipv6 }}
enb-ipv4 = {{ lan_ipv4 }}
amarisoft-version = {{ lte_version }}
license-expiration = {{ lte_expiration }}
amarisoft-version = amarisoft:lte-version
license-expiration = amarisoft:lte-expiration
monitor-gadget-url = ${:monitor-base-url}/gadget/software.cfg.html
ru-list = {{ dumps(rulib.iru_dict.keys() | sort) }}
cell-list = {{ dumps(rulib.icell_dict.keys() | sort) }}
......
......@@ -24,6 +24,8 @@ eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
{% include 'instance-amarisoft-base.jinja2.cfg' %}
{%- set icell_kind='ue' %}
{%- import 'slaplte.jinja2' as slaplte with context %}
{%- import 'ru_libinstance.jinja2.cfg' as rulib with context %}
......
......@@ -80,38 +80,6 @@ init =
assert 'xbuildout' not in sys.modules
sys.modules['xbuildout'] = xbuildout
[amarisoft]
recipe = slapos.recipe.build
init =
import os, re
try:
lte_version = sorted(filter(lambda x: re.match(r"v[0-9]{4}-[0-9]{2}-[0-9]{2}", x), os.listdir('/opt/amarisoft')))[-1][1:]
except FileNotFoundError:
lte_version = 'LTEVERSION'
path = "/opt/amarisoft/v" + lte_version
options['lte-version'] = lte_version
options['path'] = path
options['sdr'] = path + "/trx_sdr"
options['enb'] = path + "/enb"
options['mme'] = path + "/mme"
options['ims'] = path + "/mme"
options['ue'] = path + "/ue"
import os
lte_expiration = "Unknown"
amarisoft_dir = '/opt/amarisoft/.amarisoft'
try:
for filename in os.listdir(amarisoft_dir):
if filename.endswith('.key'):
with open(os.path.join(amarisoft_dir, filename), 'r') as f:
f.seek(260)
for l in f:
if l.startswith('version='):
lte_expiration = l.split('=')[1].strip()
except FileNotFoundError:
pass
options['lte-expiration'] = lte_expiration
[lan-ip]
recipe = slapos.recipe.build
init =
......@@ -142,6 +110,12 @@ enb = dynamic-template-enb:output
core-network = dynamic-template-core-network:output
ue = dynamic-template-ue:output
[dynamic-template-amarisoft-base]
< = jinja2-template-base
url = ${template-amarisoft-base:target}
filename = instance-amarisoft-base.cfg
extensions = jinja2.ext.do
[dynamic-template-enb]
< = jinja2-template-base
url = ${template-enb:target}
......@@ -170,6 +144,8 @@ extra-context =
raw fluent_bit_location ${fluent-bit:location}
raw openssh_location ${openssh:location}
raw openssh_output_keygen ${openssh-output:keygen}
import-list +=
rawfile instance-amarisoft-base.jinja2.cfg ${template-amarisoft-base:target}
[dynamic-template-core-network]
< = jinja2-template-base
......@@ -194,6 +170,8 @@ extra-context =
raw dnsmasq_location ${dnsmasq:location}
key slave_instance_list slap-configuration:slave-instance-list
section slap_configuration slap-configuration
import-list +=
rawfile instance-amarisoft-base.jinja2.cfg ${template-amarisoft-base:target}
[dynamic-template-ue]
< = jinja2-template-base
......@@ -208,7 +186,6 @@ extra-context =
raw ue_template ${ue.jinja2.cfg:target}
raw slaplte_template ${slaplte.jinja2:target}
raw openssl_location ${openssl:location}
raw ru_amarisoft_stats_template ${ru_amarisoft-stats.jinja2.py:target}
raw ru_amarisoft_rf_info_template ${ru_amarisoft-rf-info.jinja2.py:target}
raw ru_tapsplit ${ru_tapsplit:target}
......@@ -217,3 +194,5 @@ extra-context =
raw dnsmasq_location ${dnsmasq:location}
raw openssh_location ${openssh:location}
raw openssh_output_keygen ${openssh-output:keygen}
import-list +=
rawfile instance-amarisoft-base.jinja2.cfg ${template-amarisoft-base:target}
......@@ -72,6 +72,9 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
[template-ue]
<= download-base
[template-amarisoft-base]
<= download-base
[template-obsolete]
<= download-base
......
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