Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
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
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.package
Commits
8fa62919
Commit
8fa62919
authored
Jul 26, 2024
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook: ors playbook support UE mode
parent
d76dbb14
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
94 additions
and
61 deletions
+94
-61
playbook/roles/ors-image-backports/files/systemd-dhcp-network
...book/roles/ors-image-backports/files/systemd-dhcp-network
+0
-5
playbook/roles/ors-image-backports/tasks/main.yml
playbook/roles/ors-image-backports/tasks/main.yml
+0
-4
playbook/roles/ors/files/configure-re6st
playbook/roles/ors/files/configure-re6st
+0
-38
playbook/roles/ors/files/configure-slapos.py
playbook/roles/ors/files/configure-slapos.py
+7
-0
playbook/roles/ors/files/configure-sudoers
playbook/roles/ors/files/configure-sudoers
+21
-11
playbook/roles/ors/files/get-eth-interface
playbook/roles/ors/files/get-eth-interface
+12
-0
playbook/roles/ors/files/get-re6st-second-64-range
playbook/roles/ors/files/get-re6st-second-64-range
+5
-0
playbook/roles/ors/files/init-ue
playbook/roles/ors/files/init-ue
+6
-0
playbook/roles/ors/tasks/main.yml
playbook/roles/ors/tasks/main.yml
+30
-2
playbook/roles/ors/templates/systemd-ors-network.j2
playbook/roles/ors/templates/systemd-ors-network.j2
+12
-0
playbook/sha256sum
playbook/sha256sum
+1
-1
No files found.
playbook/roles/ors-image-backports/files/systemd-dhcp-network
deleted
100644 → 0
View file @
d76dbb14
[Match]
Name=en*
[Network]
DHCP=yes
playbook/roles/ors-image-backports/tasks/main.yml
View file @
8fa62919
...
@@ -71,10 +71,6 @@
...
@@ -71,10 +71,6 @@
ignore_errors
:
yes
ignore_errors
:
yes
# Configure systemd-networkd
# Configure systemd-networkd
-
name
:
Configure /etc/systemd/network/dhcp.network
copy
:
src=systemd-dhcp-network dest=/etc/systemd/network/dhcp.network owner=root mode=644
## eNB and MME addresses are on lo interface, using high MTU will result in bad throughput
## eNB and MME addresses are on lo interface, using high MTU will result in bad throughput
## for TCP when using IPv6 and phones with low MTU
## for TCP when using IPv6 and phones with low MTU
-
name
:
Configure /etc/systemd/network/lo.network
-
name
:
Configure /etc/systemd/network/lo.network
...
...
playbook/roles/ors/files/configure-re6st
deleted
100755 → 0
View file @
d76dbb14
#!/bin/bash
IF_LIST
=()
RM_IF_LIST
=()
CONF
=
"/etc/re6stnet/re6stnet.conf"
TMP
=
"/tmp/re6stnet.conf.
$(
date
+%s
)
"
cd
/sys/class/net
;
for
IF
in
$(
find
.
-type
l
-printf
"%f
\n
"
)
;
do
# If interface is virtual
if
!
realpath
$(
readlink
$IF
)
|
grep
-q
"^/sys/devices/virtual"
;
then
# If interface is up and has IPv6 neighbours
if
[
"
$(
cat
$IF
/operstate
)
"
=
"up"
]
&&
[
-n
"
$(
ip
-6
neigh list dev
$IF
)
"
]
;
then
RM_IF_LIST+
=(
$IF
)
;
fi
fi
done
cp
$CONF
$TMP
;
REPLACE
=
0
# Check if configuration is correct
for
IF
in
"
${
IF_LIST
[@]
}
"
;
do
if
!
grep
-q
"^interface
$IF
"
$TMP
;
then
REPLACE
=
1
fi
done
for
IF
in
"
${
RM_IF_LIST
[@]
}
"
;
do
if
grep
-q
"^interface
$IF
"
$TMP
;
then
REPLACE
=
1
fi
done
# Reconfigure re6st if configuration not correct
if
((
$REPLACE
))
;
then
sed
-i
'/^interface/d'
$TMP
for
IF
in
"
${
IF_LIST
[@]
}
"
;
do
echo
"interface
$IF
"
>>
$TMP
done
mv
$TMP
$CONF
;
systemctl restart re6stnet
fi
rm
-rf
$TMP
;
playbook/roles/ors/files/configure-slapos.py
View file @
8fa62919
...
@@ -24,6 +24,13 @@ with open('/opt/upgrader/configure-slapos.log', 'w+') as l:
...
@@ -24,6 +24,13 @@ with open('/opt/upgrader/configure-slapos.log', 'w+') as l:
config
=
configparser
.
ConfigParser
()
config
=
configparser
.
ConfigParser
()
config
.
read
(
CONF_PATH
)
config
.
read
(
CONF_PATH
)
# Don't create tun in UE mode
if
"lte-ue"
in
subprocess
.
run
([
'slapos'
,
'node'
],
check
=
False
,
capture_output
=
True
,
text
=
True
).
stdout
:
print
(
"In UE mode: no TUN interfaces"
)
ors_config
[
'slapformat'
][
'create_tun'
]
=
'False'
else
:
print
(
"In Base Station mode: with TUN interfaces"
)
def
is_slapformat_valid
():
def
is_slapformat_valid
():
for
k
in
ors_config
[
'slapformat'
]:
for
k
in
ors_config
[
'slapformat'
]:
if
ors_config
[
'slapformat'
][
k
]
!=
\
if
ors_config
[
'slapformat'
][
k
]
!=
\
...
...
playbook/roles/ors/files/configure-sudoers
View file @
8fa62919
#!/bin/bash
#!/bin/bash
mkdir
-p
/etc/sudoers.d
mkdir
-p
/etc/sudoers.d
COMMAND_LIST
=(
"rm-tmp-lte"
"init-enb"
"init-mme"
"init-sdr"
"get-sdr-info"
)
COMMAND_LIST
=(
"rm-tmp-lte"
"init-enb"
"init-mme"
"init-sdr"
"get-sdr-info"
"init-ue"
)
PARTITION_AMOUNT
=
"
$(
sed
-n
's/partition_amount = \(.*\)/\1/gp'
/etc/opt/slapos/slapos.cfg
)
"
PARTITION_AMOUNT
=
"
$(
sed
-n
's/partition_amount = \(.*\)/\1/gp'
/etc/opt/slapos/slapos.cfg
)
"
for
c
in
"
${
COMMAND_LIST
[@]
}
"
;
do
for
c
in
"
${
COMMAND_LIST
[@]
}
"
;
do
SLAPUSER_LINES
=
"
$(
cat
/etc/sudoers.d/slapuser-
$c
2> /dev/null |
wc
-l
)
"
SLAPUSER_LINES
=
"
$(
cat
/etc/sudoers.d/slapuser-
$c
2> /dev/null |
wc
-l
)
"
...
@@ -13,14 +13,24 @@ for c in "${COMMAND_LIST[@]}"; do
...
@@ -13,14 +13,24 @@ for c in "${COMMAND_LIST[@]}"; do
chmod
440 /etc/sudoers.d/slapuser-
$c
chmod
440 /etc/sudoers.d/slapuser-
$c
fi
fi
done
done
c
=
"sdr-util"
SLAPUSER_LINES
=
"
$(
cat
/etc/sudoers.d/slapuser-
$c
2> /dev/null |
wc
-l
)
"
AMARISOFT_PATH
=
"/opt/amarisoft/
$(
ls
-1
/opt/amarisoft |
grep
"^v[0-9]
\{
4
\}
-[0-9]
\{
2
\}
-[0-9]
\{
2
\}
$"
|
sort
|
tail
-n1
)
"
AMARISOFT_PATH
=
"/opt/amarisoft/
$(
ls
-1
/opt/amarisoft |
grep
"^v[0-9]
\{
4
\}
-[0-9]
\{
2
\}
-[0-9]
\{
2
\}
$"
|
sort
|
tail
-n1
)
"
if
[
"
$SLAPUSER_LINES
"
!=
"
$PARTITION_AMOUNT
"
]
;
then
echo
"Configuring /etc/sudoers.d/slapuser-
$c
..."
for
i
in
$(
seq
0
$((
$PARTITION_AMOUNT
-
1
))
)
;
do
c
=
"sdr-util"
echo
"slapuser
$i
ALL=NOPASSWD:
$AMARISOFT_PATH
/trx_sdr/sdr_util -c 0 version"
>>
slapuser-
$c
echo
"Configuring /etc/sudoers.d/slapuser-
$c
..."
done
for
i
in
$(
seq
0
$((
$PARTITION_AMOUNT
-
1
))
)
;
do
mv
slapuser-
$c
/etc/sudoers.d/
echo
"slapuser
$i
ALL=NOPASSWD:
$AMARISOFT_PATH
/trx_sdr/sdr_util -c 0 version"
>>
slapuser-
$c
chmod
440 /etc/sudoers.d/slapuser-
$c
done
fi
mv
slapuser-
$c
/etc/sudoers.d/
chmod
440 /etc/sudoers.d/slapuser-
$c
c
=
"lteue"
echo
"Configuring /etc/sudoers.d/slapuser-
$c
..."
echo
>
slapuser-
$c
for
i
in
$(
seq
0
$((
$PARTITION_AMOUNT
-
1
))
)
;
do
echo
"slapuser
$i
ALL=NOPASSWD:
$AMARISOFT_PATH
/ue/lteue"
>>
slapuser-
$c
done
mv
slapuser-
$c
/etc/sudoers.d/
chmod
440 /etc/sudoers.d/slapuser-
$c
playbook/roles/ors/files/get-eth-interface
0 → 100755
View file @
8fa62919
#!/bin/bash
cd
/sys/class/net
;
for
IF
in
$(
find
.
-type
l
-printf
"%f
\n
"
)
;
do
# If interface is virtual
if
!
realpath
$(
readlink
$IF
)
|
grep
-q
"^/sys/devices/virtual"
;
then
# If interface is up
if
[
"
$(
cat
$IF
/operstate
)
"
=
"up"
]
;
then
echo
-n
$IF
exit
fi
fi
done
playbook/roles/ors/files/get-re6st-second-64-range
0 → 100755
View file @
8fa62919
#!/bin/bash
# get the second /64 range of re6st /48 range
addr
=
$(
ip a show dev lo |
grep
'::1/48'
|
sed
's/inet6 //'
|
sed
's#/48.*##'
|
sed
's#::1#:1::#'
)
echo
-n
$addr
playbook/roles/ors/files/init-ue
0 → 100755
View file @
8fa62919
#!/bin/bash
AMARISOFT_PATH
=
"/opt/amarisoft/
$(
ls
-1
/opt/amarisoft |
grep
"^v[0-9]
\{
4
\}
-[0-9]
\{
2
\}
-[0-9]
\{
2
\}
$"
|
sort
|
tail
-n1
)
"
export
PATH
=
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:
$PATH
"
$AMARISOFT_PATH
/ue/lte_init.sh
;
playbook/roles/ors/tasks/main.yml
View file @
8fa62919
...
@@ -69,8 +69,18 @@
...
@@ -69,8 +69,18 @@
# Re6st
# Re6st
-
name
:
Configure re6st
-
name
:
Ensure interface enp0s31f6 is used by re6st
script
:
configure-re6st
lineinfile
:
dest=/etc/re6stnet/re6stnet.conf line="interface enp0s31f6" state=present
-
name
:
Ensure interface enp1s0 is used by re6st
lineinfile
:
dest=/etc/re6stnet/re6stnet.conf line="interface enp1s0" state=present
-
name
:
Ensure interface ue1-pdn0 is used by re6st
lineinfile
:
dest=/etc/re6stnet/re6stnet.conf line="interface ue1-pdn0" state=present
-
name
:
Ensure interface ue1-pdn0 is configured as RTT supporting link
blockinfile
:
|
dest=/etc/re6stnet/re6stnet.conf
content='
B-C
B"interface ue1-pdn0 type tunnel"'
# Slapos
# Slapos
...
@@ -97,6 +107,9 @@
...
@@ -97,6 +107,9 @@
-
name
:
Copy init-mme script
-
name
:
Copy init-mme script
copy
:
src=init-mme dest=/opt/amarisoft owner=root mode=770
copy
:
src=init-mme dest=/opt/amarisoft owner=root mode=770
-
name
:
Copy init-ue script
copy
:
src=init-ue dest=/opt/amarisoft owner=root mode=770
-
name
:
Copy rm-tmp-lte script
-
name
:
Copy rm-tmp-lte script
copy
:
src=rm-tmp-lte dest=/opt/amarisoft owner=root mode=770
copy
:
src=rm-tmp-lte dest=/opt/amarisoft owner=root mode=770
...
@@ -142,6 +155,21 @@
...
@@ -142,6 +155,21 @@
script
:
configure-sudoers
script
:
configure-sudoers
# Network
# Network
-
name
:
Get ethernet interface name
script
:
get-eth-interface
register
:
eth_interface
-
name
:
Get re6stnet second /64 range
script
:
get-re6st-second-64-range
register
:
re6st_second_range
-
name
:
Configure /etc/systemd/network/ors.network
template
:
src
:
systemd-ors-network.j2
dest
:
/etc/systemd/network/ors.network
-
name
:
Remove old /etc/systemd/network/dhcp.network
file
:
path=/etc/systemd/network/dhcp.network state=absent
-
name
:
Configure firewall
-
name
:
Configure firewall
script
:
configure-firewall
script
:
configure-firewall
...
...
playbook/roles/ors/templates/systemd-ors-network.j2
0 → 100644
View file @
8fa62919
[Match]
Name=en*
[Network]
DHCP=yes
[Match]
name={{ eth_interface.stdout }}
[Network]
Address={{ re6st_second_range.stdout }}1/64
playbook/sha256sum
View file @
8fa62919
007dcca4a3c2afdb420092f8b3c7795d2a7c1552efac2bc3635d65ddd8a01dff
-
711a63ffbf68a76a43290aada8cb0281391f589ffebe4401e2c8531176b7fe2a
-
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