Skip to content

Commit

Permalink
fix salt permission
Browse files Browse the repository at this point in the history
  • Loading branch information
mbussolotto committed Sep 20, 2023
1 parent 9cec25e commit b7e27aa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion susemanager/bin/mgr-setup
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ fi
# goal would be to move everything here.
#
setup_apache() {

sed -i 's|DocumentRoot "/srv|DocumentRoot "/usr/share/susemanager|g' /etc/apache2/default-server.conf
sed -i 's|<Directory "/srv|<Directory "/usr/share/susemanager|g' /etc/apache2/default-server.conf
sed -i 's|<Directory "/srv|<Directory "/usr/share/susemanager|g' /etc/apache2/conf.d/zz-spacewalk-www.conf
Expand All @@ -423,6 +422,15 @@ setup_apache() {
sed -i 's|DocumentRoot "/srv|DocumentRoot "/usr/share/susemanager|g' /etc/apache2/vhosts.d/vhost-ssl.template
}

#TODO move this on the permission check function
setup_permission() {
mkdir -p /srv/susemanager/salt/tmp
mkdir -p /srv/susemanager/salt/custom
chown tomcat:susemanager -R /srv/susemanager/salt/tmp
chown tomcat:susemanager -R /srv/susemanager/salt/custom
chmod 775 -R /srv/susemanager/salt/tmp
chmod 775 -R /srv/susemanager/salt/custom
}

setup_spacewalk() {
CERT_COUNTRY=`echo -n $CERT_COUNTRY|tr '[:lower:]' '[:upper:]'`
Expand Down Expand Up @@ -524,6 +532,8 @@ ssl-server-key = $SERVER_KEY" >> /root/spacewalk-answers

setup_apache

setup_permission

# rm /root/spacewalk-answers
if [ "$SWRET" != "0" ]; then
echo "ERROR: spacewalk-setup failed" >&2
Expand Down

0 comments on commit b7e27aa

Please sign in to comment.