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
Romain Courteaud
slapos.package
Commits
459e7225
Commit
459e7225
authored
Aug 31, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook/ors-upgrade: configure network and sshd
parent
b7f10319
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
playbook/roles/ors-upgrade/files/configure-network.sh
playbook/roles/ors-upgrade/files/configure-network.sh
+12
-1
playbook/roles/ors-upgrade/files/configure-ssh.sh
playbook/roles/ors-upgrade/files/configure-ssh.sh
+12
-0
playbook/roles/ors-upgrade/tasks/main.yml
playbook/roles/ors-upgrade/tasks/main.yml
+5
-2
No files found.
playbook/roles/ors-upgrade/files/configure-
re6st
.sh
→
playbook/roles/ors-upgrade/files/configure-
network
.sh
View file @
459e7225
#!/bin/bash
CONF
=
"/etc/re6stnet/re6stnet.conf"
CONF
=
"/etc/network/interfaces"
BAK
=
"/tmp/interfaces.
$(
date
+%s
)
"
IFACE
=
"
$(
ip route |
grep
default |
sed
's/.*dev \(\w*\)\( .*$\|$\)/\1/g'
)
"
cp
$CONF
$BAK
;
if
!
grep
-q
ip6tables
$CONF
;
then
sed
-i
's#^\(\s*post-up \)iptables\(.*\)$#\1iptables\2\n\1ip6tables\2#g'
$CONF
;
fi
if
!
ifup
--no-act
$IFACE
;
then
cp
$BAK
$CONF
;
fi
rm
-rf
$BAK
;
CONF
=
"/etc/re6stnet/re6stnet.conf"
sed
-i
'/^interface/d'
$CONF
echo
"interface
$IFACE
"
>>
$CONF
if
!
ps
-ax
-o
cmd |
grep
babeld |
grep
-q
$IFACE
;
then
...
...
playbook/roles/ors-upgrade/files/configure-ssh.sh
0 → 100755
View file @
459e7225
#!/bin/bash
CONF
=
"/etc/ssh/sshd_config"
if
!
grep
-q
"^PermitRootLogin yes$"
$CONF
;
then
sed
-i
'/^PermitRootLogin/d'
$CONF
;
echo
"PermitRootLogin yes"
>>
$CONF
;
systemctl restart sshd
;
fi
if
!
grep
-q
"^PasswordAuthentication yes$"
$CONF
;
then
sed
-i
'/^PasswordAuthentication/d'
$CONF
;
echo
"PasswordAuthentication yes"
>>
$CONF
;
systemctl restart sshd
;
fi
playbook/roles/ors-upgrade/tasks/main.yml
View file @
459e7225
...
...
@@ -18,8 +18,11 @@
-
name
:
Enable init-sdr
systemd
:
name=init-sdr enabled=yes
-
name
:
Configure re6st
script
:
configure-re6st.sh
-
name
:
Configure network
script
:
configure-network.sh
-
name
:
Configure ssh
script
:
configure-ssh.sh
-
name
:
Configure slapos
script
:
configure-slapos.py
...
...
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