Verified Commit 827860d1 authored by Alex Iribarren's avatar Alex Iribarren
Browse files

Send installation logs to central server

parent 51e87a65
Pipeline #3304871 failed with stages
in 26 minutes and 52 seconds
...@@ -56,6 +56,34 @@ yum-plugin-ovl ...@@ -56,6 +56,34 @@ yum-plugin-ovl
%end %end
%pre
ARCH=`uname -m`
cat >> /etc/rsyslog.conf <<DELIM
\$template AnacondaTemplate, "<%PRI%>%TIMESTAMP:::date-rfc3339% image:cc7-base-docker-$ARCH %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%"
\$ActionForwardDefaultTemplate AnacondaTemplate
module(load="imfile" mode="inotify")
input(type="imfile"
File="/tmp/anaconda.log"
Tag="anaconda")
input(type="imfile"
File="/tmp/dnf.librepo.log"
Tag="dnf-librepo")
input(type="imfile"
File="/tmp/packaging.log"
Tag="packaging")
input(type="imfile"
File="/tmp/ks-script-*.log"
Tag="ks-pre")
input(type="imfile"
File="/mnt/sysroot/root/ks-post.log"
Tag="ks-post")
*.* @@linuxsoftadm.cern.ch:5014
DELIM
/usr/bin/systemctl restart rsyslog
%end
%post --log=/root/ks-post.log %post --log=/root/ks-post.log
# randomize root password and lock root account # randomize root password and lock root account
dd if=/dev/urandom count=50 | md5sum | passwd --stdin root dd if=/dev/urandom count=50 | md5sum | passwd --stdin root
...@@ -205,7 +233,11 @@ SSL start_tls ...@@ -205,7 +233,11 @@ SSL start_tls
SASL_NOCANON on SASL_NOCANON on
EOF EOF
%end
%post --nochroot
# Make rsyslog send everything before the reboot
pkill -HUP rsyslogd
sleep 30s
rm -rf /mnt/sysroot/root/ks-post.log
%end %end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment