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
14
Merge Requests
14
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
c1332e4f
Commit
c1332e4f
authored
Sep 08, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ors-amarisoft: update playbook and run it after reboot
parent
5920d2c3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
39 deletions
+61
-39
playbook/roles/ors-upgrade/files/configure-grub.sh
playbook/roles/ors-upgrade/files/configure-grub.sh
+13
-0
playbook/roles/ors-upgrade/files/configure-re6st.sh
playbook/roles/ors-upgrade/files/configure-re6st.sh
+11
-0
playbook/roles/ors-upgrade/files/configure-ssh.sh
playbook/roles/ors-upgrade/files/configure-ssh.sh
+0
-12
playbook/roles/ors-upgrade/files/init-sdr
playbook/roles/ors-upgrade/files/init-sdr
+0
-20
playbook/roles/ors-upgrade/files/init-sdr.sh
playbook/roles/ors-upgrade/files/init-sdr.sh
+4
-0
playbook/roles/ors-upgrade/files/interfaces
playbook/roles/ors-upgrade/files/interfaces
+14
-0
playbook/roles/ors-upgrade/tasks/main.yml
playbook/roles/ors-upgrade/tasks/main.yml
+16
-7
playbook/roles/ors/tasks/main.yml
playbook/roles/ors/tasks/main.yml
+3
-0
No files found.
playbook/roles/ors-upgrade/files/configure-grub.sh
0 → 100755
View file @
c1332e4f
#!/bin/bash
CONF
=
"/etc/default/grub"
BAK
=
"/tmp/default.grub"
cp
$CONF
$BAK
;
if
!
grep
-q
idle
=
halt /proc/cmdline
;
then
sed
-i
's/^\(GRUB_CMDLINE_LINUX_DEFAULT.*\)idle=[a-z]* *\(.*\)/\1\2/g'
$CONF
;
sed
-i
's/^\(GRUB_CMDLINE_LINUX_DEFAULT.*\)"/\1 idle=halt"/g'
$CONF
;
if
!
update-grub
;
then
cp
$BAK
$CONF
;
update-grub
;
fi
fi
rm
-f
$BAK
;
playbook/roles/ors-upgrade/files/configure-
network
.sh
→
playbook/roles/ors-upgrade/files/configure-
re6st
.sh
View file @
c1332e4f
#!/bin/bash
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
# Don't run re6st with interface option at Lille Office
if
ping6
-q
-c2
-w3
fe80::20d:b9ff:fe3f:9055%
$IFACE
;
then
systemctl stop re6stnet
;
elif
!
ps
-ax
-o
cmd |
grep
babeld |
grep
-q
$IFACE
;
then
systemctl restart re6stnet
;
fi
playbook/roles/ors-upgrade/files/configure-ssh.sh
deleted
100755 → 0
View file @
5920d2c3
#!/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/files/init-sdr
deleted
100755 → 0
View file @
5920d2c3
#!/bin/sh
### BEGIN INIT INFO
# Provides: Init SDR
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Init SDR
### END INIT INFO
case
"
$1
"
in
start
)
cd
/root/trx_sdr/kernel
;
make clean
;
bash init.sh 2>> /opt/amarisoft/init-sdr.log
>>
/opt/amarisoft/init-sdr.log
/opt/amarisoft/v2022-07-29/lteenb-linux-2022-07-29/lte_init.sh 2>> /opt/amarisoft/init-sdr.log
>>
/opt/amarisoft/init-sdr.log
;;
*
)
true
esac
playbook/roles/ors-upgrade/files/init-sdr.sh
0 → 100755
View file @
c1332e4f
cd
/root/trx_sdr/kernel
;
make clean
;
bash init.sh 2>> /opt/amarisoft/init-sdr.log
>>
/opt/amarisoft/init-sdr.log
$(
find /opt/amarisoft
-type
f
-wholename
"*v*/*lteenb*/*lte_init.sh*"
)
2>> /opt/amarisoft/init-sdr.log
>>
/opt/amarisoft/init-sdr.log
playbook/roles/ors-upgrade/files/interfaces
0 → 100644
View file @
c1332e4f
auto lo
iface lo inet loopback
auto enp2s0
iface enp2s0 inet dhcp
post-up echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
post-up iptables -t nat -A POSTROUTING -o enp2s0 -j MASQUERADE
post-up ip6tables -t nat -A POSTROUTING -o enp2s0 -j MASQUERADE
auto enp0s31f6
iface enp0s31f6 inet dhcp
post-up echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
post-up iptables -t nat -A POSTROUTING -o enp0s31f6 -j MASQUERADE
post-up ip6tables -t nat -A POSTROUTING -o enp0s31f6 -j MASQUERADE
playbook/roles/ors-upgrade/tasks/main.yml
View file @
c1332e4f
...
...
@@ -12,17 +12,23 @@
-
name
:
Give permission to slapuser to remove tmp files owned by other slapuser
copy
:
src=slapuser-rm-tmp dest=/etc/sudoers.d owner=root mode=440
-
name
:
Add init-sdr service
copy
:
src=init-sdr dest=/etc/init.d owner=root mode=755
-
name
:
Init SDR
script
:
init-sdr.sh
-
name
:
Enable init-sdr
s
ystemd
:
name=init-sdr enabled=yes
-
name
:
Configure re6st
s
cript
:
configure-re6st.sh
-
name
:
Configure network
script
:
configure-network.sh
-
name
:
Configure /etc/network/interfaces
copy
:
src=interfaces dest=/etc/network/interfaces owner=root mode=644
-
name
:
Configure dhcp timeout
lineinfile
:
dest=/etc/dhcp/dhclient.conf regexp="^timeout (.*)" line="timeout 15" state=present
-
name
:
Configure ssh
lineinfile
:
dest=/etc/ssh/sshd_config regexp="^PermitRootLogin (.*)" line="PermitRootLogin yes" state=present
-
name
:
Configure ssh
script
:
configure-ssh.sh
lineinfile
:
dest=/etc/ssh/sshd_config regexp="^PasswordAuthentication (.*)" line="PasswordAuthentication yes" state=present
-
name
:
Configure slapos
script
:
configure-slapos.py
...
...
@@ -32,3 +38,6 @@
-
name
:
Copy keys for SR
copy
:
src=/root/.amarisoft dest=/opt/amarisoft owner=root mode=644
-
name
:
Add kernel parameter
script
:
configure-grub.sh
playbook/roles/ors/tasks/main.yml
View file @
c1332e4f
---
-
name
:
Install upgrader
shell
:
ansible-playbook upgrader-run.yml --extra-vars "upgrader_playbook=ors-upgrade.yml upgrade_kernel=False"
-
name
:
Set Cron
cron
:
name="Launch Startup with ansible" special_time=reboot job='cd /opt/upgrader/playbook && ansible-playbook ors-upgrade.yml -i hosts 2>>/opt/upgrader/startup.log >> /opt/upgrader/startup.log'
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