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
Steven Gueguen
slapos
Commits
905ee4b3
Commit
905ee4b3
authored
May 10, 2023
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ors-amarisoft: dnsmasq: add domain parameter and publish subdomain
parent
0ebe135e
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 @
905ee4b3
...
@@ -44,7 +44,7 @@ md5sum = b2a1816ceb8e7f475e71454e5389d091
...
@@ -44,7 +44,7 @@ md5sum = b2a1816ceb8e7f475e71454e5389d091
[template-core-network]
[template-core-network]
_update_hash_filename_ = instance-core-network.jinja2.cfg
_update_hash_filename_ = instance-core-network.jinja2.cfg
md5sum =
b4af66e7cdb3be1d48eabd14488bea24
md5sum =
d39aa3cda900b31cb57f29bd10592102
[template-ue-lte]
[template-ue-lte]
_update_hash_filename_ = instance-ue-lte.jinja2.cfg
_update_hash_filename_ = instance-ue-lte.jinja2.cfg
...
@@ -80,11 +80,11 @@ md5sum = 1ba2e065bdf14a6411e95e80db17dcfd
...
@@ -80,11 +80,11 @@ md5sum = 1ba2e065bdf14a6411e95e80db17dcfd
[mme.jinja2.cfg]
[mme.jinja2.cfg]
filename = config/mme.jinja2.cfg
filename = config/mme.jinja2.cfg
md5sum =
c153d191c91a3bf28bae8724b0deb616
md5sum =
48b577daa5b53c2cf7fe2d30ea9c0235
[dnsmasq.jinja2.cfg]
[dnsmasq.jinja2.cfg]
filename = config/dnsmasq.jinja2.cfg
filename = config/dnsmasq.jinja2.cfg
md5sum =
159942a0ffd9f73a5af6fb578037cd4b
md5sum =
05a983d97898813d5953fef4d03333a1
[ims.jinja2.cfg]
[ims.jinja2.cfg]
filename = config/ims.jinja2.cfg
filename = config/ims.jinja2.cfg
...
...
software/ors-amarisoft/config/dnsmasq.jinja2.cfg
View file @
905ee4b3
...
@@ -8,11 +8,11 @@ port=5353
...
@@ -8,11 +8,11 @@ port=5353
{%- else %}
{%- else %}
{%- set slave = slave_instance %}
{%- set slave = slave_instance %}
{%- endif %}
{%- endif %}
{%- if slave.get('domain', '') != '' %}
{%- if slave.get('
sub
domain', '') != '' %}
{%- do filtered_slave_instance_list.append(slave) %}
{%- do filtered_slave_instance_list.append(slave) %}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- endfor %}
{% for i, slave in enumerate(filtered_slave_instance_list) -%}
{% 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 -%}
{% endfor -%}
software/ors-amarisoft/config/mme.jinja2.cfg
View file @
905ee4b3
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
pdn_type: "ipv4v6",
pdn_type: "ipv4v6",
first_ipv6_prefix: "{{ netaddr.IPAddress(slap_configuration.get('tun-ipv6-addr', '')) + 1 }}",
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 }}",
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', '') }}"],
dns_addr: ["{{ slap_configuration.get('tun-ipv4-addr', '') }}"],
{% else %}
{% else %}
dns_addr: ["8.8.8.8", "2001:4860:4860::8888"],
dns_addr: ["8.8.8.8", "2001:4860:4860::8888"],
...
...
software/ors-amarisoft/instance-core-network-input-schema.json
View file @
905ee4b3
...
@@ -21,11 +21,11 @@
...
@@ -21,11 +21,11 @@
"description"
:
"Activate iperf3 UDP server"
,
"description"
:
"Activate iperf3 UDP server"
,
"type"
:
"boolean"
"type"
:
"boolean"
},
},
"
dnsmasq
"
:
{
"
local_domain
"
:
{
"default"
:
false
,
"default"
:
""
,
"title"
:
"
dnsmasq
"
,
"title"
:
"
Local Domain
"
,
"description"
:
"
dnsmasq
"
,
"description"
:
"
Activates local DNS server serving the given domain name
"
,
"type"
:
"
boolean
"
"type"
:
"
string
"
},
},
"use_ipv4"
:
{
"use_ipv4"
:
{
"default"
:
false
,
"default"
:
false
,
...
...
software/ors-amarisoft/instance-core-network.jinja2.cfg
View file @
905ee4b3
{%- 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 = [] -%}
{% 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_parameters = json_module.loads(slave['_']) %}
{% set slave_reference = slave.get('slave_reference', '') %}
{% set slave_reference = slave.get('slave_reference', '') %}
{% set publish_section_title = 'publish-%s' % slave_reference %}
{% set publish_section_title = 'publish-%s' % slave_reference %}
...
@@ -10,6 +21,19 @@ recipe = slapos.cookbook:publish.serialised
...
@@ -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}.
info = Your SIM card with IMSI {{ slave_parameters.get('imsi', '') }} has been attached to service ${slap-configuration:instance-title}.
{%- endfor %}
{%- 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]
[buildout]
parts =
parts =
directory
directory
...
@@ -24,7 +48,7 @@ parts =
...
@@ -24,7 +48,7 @@ parts =
iperf-service
iperf-service
iperf-listen-promise
iperf-listen-promise
{% endif %}
{% endif %}
{% if slapparameter_dict.get("
dnsmasq", None
) %}
{% if slapparameter_dict.get("
local_domain", ''
) %}
dnsmasq-service
dnsmasq-service
{% endif %}
{% endif %}
{% for part in part_list -%}
{% for part in part_list -%}
...
@@ -207,7 +231,7 @@ url = {{ mme_template }}
...
@@ -207,7 +231,7 @@ url = {{ mme_template }}
{% endif %}
{% endif %}
output = ${directory:etc}/mme.cfg
output = ${directory:etc}/mme.cfg
{% if slapparameter_dict.get("
dnsmasq", None
) %}
{% if slapparameter_dict.get("
local_domain", ''
) %}
[dnsmasq-service]
[dnsmasq-service]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
port = 5353
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