Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
slapos
Commits
a7f2040b
Commit
a7f2040b
authored
May 10, 2023
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: dnsmasq
parent
d4386fe6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
14 deletions
+38
-14
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+3
-3
software/ors-amarisoft/config/dnsmasq.jinja2.cfg
software/ors-amarisoft/config/dnsmasq.jinja2.cfg
+2
-2
software/ors-amarisoft/config/mme.jinja2.cfg
software/ors-amarisoft/config/mme.jinja2.cfg
+1
-1
software/ors-amarisoft/instance-core-network-input-schema.json
...are/ors-amarisoft/instance-core-network-input-schema.json
+5
-5
software/ors-amarisoft/instance-core-network.jinja2.cfg
software/ors-amarisoft/instance-core-network.jinja2.cfg
+27
-3
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
a7f2040b
...
...
@@ -44,7 +44,7 @@ md5sum = b2a1816ceb8e7f475e71454e5389d091
[template-core-network]
_update_hash_filename_ = instance-core-network.jinja2.cfg
md5sum =
b4af66e7cdb3be1d48eabd14488bea24
md5sum =
d39aa3cda900b31cb57f29bd10592102
[template-ue-lte]
_update_hash_filename_ = instance-ue-lte.jinja2.cfg
...
...
@@ -80,11 +80,11 @@ md5sum = 1ba2e065bdf14a6411e95e80db17dcfd
[mme.jinja2.cfg]
filename = config/mme.jinja2.cfg
md5sum =
c153d191c91a3bf28bae8724b0deb616
md5sum =
48b577daa5b53c2cf7fe2d30ea9c0235
[dnsmasq.jinja2.cfg]
filename = config/dnsmasq.jinja2.cfg
md5sum =
159942a0ffd9f73a5af6fb578037cd4b
md5sum =
05a983d97898813d5953fef4d03333a1
[ims.jinja2.cfg]
filename = config/ims.jinja2.cfg
...
...
software/ors-amarisoft/config/dnsmasq.jinja2.cfg
View file @
a7f2040b
...
...
@@ -8,11 +8,11 @@ port=5353
{%- else %}
{%- set slave = slave_instance %}
{%- endif %}
{%- if slave.get('domain', '') != '' %}
{%- if slave.get('
sub
domain', '') != '' %}
{%- do filtered_slave_instance_list.append(slave) %}
{%- endif %}
{%- endfor %}
{% for i, slave in enumerate(filtered_slave_instance_list) -%}
address=/{{ slave['
domain']
}}/{{ slave.get('ip', '') }}
address=/{{ slave['
subdomain'] }}.{{ slap_configuration.get('local_domain', '')
}}/{{ slave.get('ip', '') }}
{% endfor -%}
software/ors-amarisoft/config/mme.jinja2.cfg
View file @
a7f2040b
...
...
@@ -55,7 +55,7 @@
pdn_type: "ipv4v6",
first_ipv6_prefix: "{{ netaddr.IPAddress(slap_configuration.get('tun-ipv6-addr', '')) + 1 }}",
last_ipv6_prefix: "{{ netaddr.IPAddress(netaddr.IPNetwork(slap_configuration.get('tun-ipv6-network', '')).last) - 1 }}",
{% if slapparameter_dict.get('
dnsmasq', False
) %}
{% if slapparameter_dict.get('
local_domain', ''
) %}
dns_addr: ["{{ slap_configuration.get('tun-ipv4-addr', '') }}"],
{% else %}
dns_addr: ["8.8.8.8", "2001:4860:4860::8888"],
...
...
software/ors-amarisoft/instance-core-network-input-schema.json
View file @
a7f2040b
...
...
@@ -21,11 +21,11 @@
"description"
:
"Activate iperf3 UDP server"
,
"type"
:
"boolean"
},
"
dnsmasq
"
:
{
"default"
:
false
,
"title"
:
"
dnsmasq
"
,
"description"
:
"
dnsmasq
"
,
"type"
:
"
boolean
"
"
local_domain
"
:
{
"default"
:
""
,
"title"
:
"
Local Domain
"
,
"description"
:
"
Activates local DNS server serving the given domain name
"
,
"type"
:
"
string
"
},
"use_ipv4"
:
{
"default"
:
false
,
...
...
software/ors-amarisoft/instance-core-network.jinja2.cfg
View file @
a7f2040b
{%- set dns_slave_instance_list = [] %}
{%- set sim_slave_instance_list = [] %}
{%- for slave in slave_instance_list %}
{%- set slave_parameters = json_module.loads(slave['_']) %}
{%- if slave_parameters.get('subdomain', '') != '' %}
{%- do dns_slave_instance_list.append(slave) %}
{%- elif slave_parameters.get('imsi', '') != '' %}
{%- do sim_slave_instance_list.append(slave) %}
{%- endif %}
{%- endfor %}
{% set part_list = [] -%}
{%- for
i, slave in enumerate(slave_instance_list)
%}
{%- for
slave in sim_slave_instance_list
%}
{%- set slave_parameters = json_module.loads(slave['_']) %}
{% set slave_reference = slave.get('slave_reference', '') %}
{% set publish_section_title = 'publish-%s' % slave_reference %}
...
...
@@ -10,6 +21,19 @@ recipe = slapos.cookbook:publish.serialised
info = Your SIM card with IMSI {{ slave_parameters.get('imsi', '') }} has been attached to service ${slap-configuration:instance-title}.
{%- endfor %}
{%- for slave in dns_slave_instance_list %}
{%- set slave_parameters = json_module.loads(slave['_']) %}
{% set slave_reference = slave.get('slave_reference', '') %}
{% set publish_section_title = 'publish-%s' % slave_reference %}
{% do part_list.append(publish_section_title) %}
[{{ publish_section_title }}]
recipe = slapos.cookbook:publish.serialised
-slave-reference = {{ slave_reference }}
domain = {{ slave_parameters['subdomain'] }}.{{ slapparameter_dict.get('local_domain', '') }}
ip = {{ slave_parameters.get('ip', '') }}
info = DNS entry with has been attached to service ${slap-configuration:instance-title}.
{%- endfor %}
[buildout]
parts =
directory
...
...
@@ -24,7 +48,7 @@ parts =
iperf-service
iperf-listen-promise
{% endif %}
{% if slapparameter_dict.get("
dnsmasq", None
) %}
{% if slapparameter_dict.get("
local_domain", ''
) %}
dnsmasq-service
{% endif %}
{% for part in part_list -%}
...
...
@@ -207,7 +231,7 @@ url = {{ mme_template }}
{% endif %}
output = ${directory:etc}/mme.cfg
{% if slapparameter_dict.get("
dnsmasq", None
) %}
{% if slapparameter_dict.get("
local_domain", ''
) %}
[dnsmasq-service]
recipe = slapos.cookbook:wrapper
port = 5353
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment