Skip to content

Commit e490193

Browse files
authored
Merge pull request #628 from uyuni-project/main-bsc1244027
Update Cobbler settings file to a new dedicated path (bsc#1244027)
2 parents cb3d0d0 + b2bb2fb commit e490193

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

mgradm/shared/templates/migrateScriptTemplate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ sed 's/^report_db_host = .*/report_db_host = {{ .ReportDBHost }}/' -i /etc/rhn/r
163163
if ! grep -q '^java.hostname *=' /etc/rhn/rhn.conf; then
164164
sed 's/server\.jabber_server/java\.hostname/' -i /etc/rhn/rhn.conf;
165165
fi
166-
sed 's/client_use_localhost: false/client_use_localhost: true/' -i /etc/cobbler/settings.yaml;
166+
echo 'client_use_localhost: true' >> /etc/cobbler/settings.d/zz-uyuni.settings;
167167
168168
echo "Altering configuration for container environment..."
169169
sed 's/address=[^:]*:/address=*:/' -i /etc/rhn/taskomatic.conf;

mgradm/shared/templates/postUpgradeScriptTemplate.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ import (
1111

1212
const postUpgradeScriptTemplate = `
1313
sed 's/cobbler\.host.*/cobbler\.host = localhost/' -i /etc/rhn/rhn.conf;
14-
grep uyuni_authentication_endpoint /etc/cobbler/settings.yaml
15-
if [ $? -eq 1 ]; then
16-
echo 'uyuni_authentication_endpoint: "http://localhost"' >> /etc/cobbler/settings.yaml
14+
if grep -q uyuni_authentication_endpoint /etc/cobbler/settings.d/zz-uyuni.settings; then
15+
echo 'uyuni_authentication_endpoint: "http://localhost"' >> /etc/cobbler/settings.d/zz-uyuni.settings
1716
else
1817
sed 's/uyuni_authentication_endpoint.*/uyuni_authentication_endpoint: http:\/\/localhost/' \
19-
-i /etc/cobbler/settings.yaml;
18+
-i /etc/cobbler/settings.d/zz-uyuni.settings;
2019
fi
2120
22-
grep pam_auth_service /etc/rhn/rhn.conf
23-
if [ $? -eq 1 ]; then
21+
if grep -q pam_auth_service /etc/rhn/rhn.conf; then
2422
echo 'pam_auth_service = susemanager' >> /etc/rhn/rhn.conf
2523
else
2624
sed 's/pam_auth_service.*/pam_auth_service = susemanager/' -i /etc/rhn/rhn.conf;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Use new dedicated path for Cobbler settings (bsc#1244027)

0 commit comments

Comments
 (0)