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
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
Xiaowu Zhang
slapos.package
Commits
fab03121
Commit
fab03121
authored
Aug 18, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook/ors-upgrade: add re6st and slapos configuration
parent
2b5d29ea
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
0 deletions
+64
-0
playbook/roles/ors-upgrade/files/configure-re6st.sh
playbook/roles/ors-upgrade/files/configure-re6st.sh
+8
-0
playbook/roles/ors-upgrade/files/configure-slapos.py
playbook/roles/ors-upgrade/files/configure-slapos.py
+44
-0
playbook/roles/ors-upgrade/tasks/main.yml
playbook/roles/ors-upgrade/tasks/main.yml
+12
-0
No files found.
playbook/roles/ors-upgrade/files/configure-re6st.sh
0 → 100755
View file @
fab03121
#!/bin/bash
CONF
=
"/etc/re6stnet/re6stnet.conf"
IFACE
=
"
$(
ip route |
grep
default |
sed
's/.*dev \(\w*\)\( .*$\|$\)/\1/g'
)
"
sed
-i
'/^interface/d'
$CONF
echo
"interface
$IFACE
"
>>
$CONF
if
!
ps
-ax
-o
cmd |
grep
babeld |
grep
-q
$IFACE
;
then
systemctl restart re6stnet
;
fi
playbook/roles/ors-upgrade/files/configure-slapos.py
0 → 100644
View file @
fab03121
#!/usr/bin/env python3
import
configparser
import
subprocess
CONF_PATH
=
"/etc/opt/slapos/slapos.cfg"
ors_config
=
{
'slapformat'
:
{
'create_tun'
:
'True'
,
'create_tap'
:
'False'
,
'partition_amount'
:
'20'
,
},
'networkcache'
:
{
'download-from-binary-cache-force-url-list'
:
'''
https://lab.nexedi.com/nexedi/slapos/raw/1.
https://lab.node.vifib.com/nexedi/slapos/raw/1.0.'''
,
},
}
config
=
configparser
.
ConfigParser
()
config
.
read
(
CONF_PATH
)
def
is_slapformat_valid
():
for
k
in
ors_config
[
'slapformat'
]:
if
ors_config
[
'slapformat'
][
k
]
!=
\
config
.
setdefault
(
'slapformat'
,
{}).
setdefault
(
k
,
''
):
return
False
return
True
slapformat_valid
=
is_slapformat_valid
()
config
[
'slapformat'
].
update
(
ors_config
[
'slapformat'
])
config
[
'networkcache'
].
update
(
ors_config
[
'networkcache'
])
with
open
(
CONF_PATH
,
'w+'
)
as
f
:
config
.
write
(
f
)
if
not
slapformat_valid
:
# Delete routes
s
=
subprocess
.
run
([
'ip'
,
'route'
],
check
=
True
,
capture_output
=
True
)
for
r
in
s
.
stdout
.
decode
().
split
(
'
\
n
'
):
if
"slaptun"
in
r
:
l
=
r
.
split
(
' '
)
subprocess
.
run
([
'ip'
,
'route'
,
'del'
,]
+
l
[:
l
.
index
(
'dev'
)
+
2
],
check
=
True
)
subprocess
.
run
([
'rm'
,
'-f'
,
'/opt/slapos/slapos.xml'
],
check
=
True
)
subprocess
.
run
([
'slapos'
,
'node'
,
'format'
,
'--now'
],
check
=
True
,
capture_output
=
True
)
playbook/roles/ors-upgrade/tasks/main.yml
View file @
fab03121
...
...
@@ -17,3 +17,15 @@
-
name
:
Enable init-sdr
systemd
:
name=init-sdr enabled=yes
-
name
:
Configure re6st
script
:
configure-re6st.sh
-
name
:
Configure slapos
script
:
configure-slapos.py
-
name
:
Create .amarisoft directory for SR
file
:
path=/opt/amarisoft/.amarisoft state=directory
-
name
:
Copy keys for SR
copy
:
src=/root/.amarisoft dest=/opt/amarisoft owner=root mode=644
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