Skip to content

Commit

Permalink
move config file to mgr-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mbussolotto committed Aug 23, 2023
1 parent a8530b7 commit cc7636d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
15 changes: 0 additions & 15 deletions spacewalk/setup/spacewalk-setup.spec
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,6 @@ if [ -f /etc/rhn/rhn.conf -a $(filesize /etc/rhn/rhn.conf) -gt 1 ]; then
CURRENT_DATE=$(date +"%%Y-%%m-%%dT%%H:%%M:%%S.%%3N")
cp /etc/tomcat/server.xml /etc/tomcat/server.xml.$CURRENT_DATE
xsltproc %{_datadir}/spacewalk/setup/server_update.xml.xsl /etc/tomcat/server.xml.$CURRENT_DATE > /etc/tomcat/server.xml
else
# rhn.conf does not exists or is empty, this is new installation or update of new installation
CURRENT_DATE=$(date +"%%Y-%%m-%%dT%%H:%%M:%%S.%%3N")
cp /etc/tomcat/server.xml /etc/tomcat/server.xml.$CURRENT_DATE
xsltproc %{_datadir}/spacewalk/setup/server.xml.xsl /etc/tomcat/server.xml.$CURRENT_DATE > /etc/tomcat/server.xml
fi

if [ -e /etc/zypp/credentials.d/SCCcredentials ]; then
chgrp www /etc/zypp/credentials.d/SCCcredentials
chmod g+r /etc/zypp/credentials.d/SCCcredentials
fi

if [ -d /var/cache/salt/master/thin ]; then
# clean the thin cache
rm -rf /var/cache/salt/master/thin
fi

# sudoers file is now in /etc/sudoers.d/spacewalk
Expand Down
29 changes: 27 additions & 2 deletions susemanager/bin/mgr-setup
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,28 @@ setup_apache() {
sysconf_addword /etc/sysconfig/apache2 APACHE_MODULES wsgi
}

setup_tomcat {
if [ -f /etc/rhn/rhn.conf -a $(filesize /etc/rhn/rhn.conf) -gt 1 ]; then
# rhn.conf is configured, this is an upgrade
# during upgrade, setup new connectionTimeout if the user didn't change it. Keeping it until SUMA 4.2 is maintained
CURRENT_DATE=$(date +"%%Y-%%m-%%dT%%H:%%M:%%S.%%3N")
cp /etc/tomcat/server.xml /etc/tomcat/server.xml.$CURRENT_DATE
xsltproc %{_datadir}/spacewalk/setup/server_update.xml.xsl /etc/tomcat/server.xml.$CURRENT_DATE > /etc/tomcat/server.xml
else
# rhn.conf does not exists or is empty, this is new installation or update of new installation
CURRENT_DATE=$(date +"%%Y-%%m-%%dT%%H:%%M:%%S.%%3N")
cp /etc/tomcat/server.xml /etc/tomcat/server.xml.$CURRENT_DATE
xsltproc %{_datadir}/spacewalk/setup/server.xml.xsl /etc/tomcat/server.xml.$CURRENT_DATE > /etc/tomcat/server.xml
fi
}

change_SSCcredentials_permission {
if [ -e /etc/zypp/credentials.d/SCCcredentials ]; then
chgrp www /etc/zypp/credentials.d/SCCcredentials
chmod g+r /etc/zypp/credentials.d/SCCcredentials
fi
}

setup_cobbler() {
if [ -f "/etc/cobbler/settings" ]; then
if ! grep "tftpsync_timeout:" /etc/cobbler/settings >/dev/null; then
Expand All @@ -420,6 +442,9 @@ setup_cobbler() {
echo "" >> /etc/cobbler/settings
fi
fi
if grep 'authn_spacewalk' /etc/cobbler/modules.conf > /dev/null 2>&1; then
sed -i 's/module = authn_spacewalk/module = authentication.spacewalk/' /etc/cobbler/modules.conf
fi
}

setup_spacewalk() {
Expand Down Expand Up @@ -921,10 +946,10 @@ do_setup() {
fi

setup_spacewalk

setup_apache

setup_tomcat
setup_cobbler
change_SSCcredentials_permission

# In the container case, we have the MIRROR_PATH environment variable at setup
if [ -n "$MIRROR_PATH" ]; then
Expand Down

0 comments on commit cc7636d

Please sign in to comment.