Skip to content

Commit

Permalink
Only add the java.hostname on migration if not already present
Browse files Browse the repository at this point in the history
More recent servers already have java.hostname in rhn.conf... adding it
at migration would add two lines and blow when inspecting the container
later at upgrade time.
  • Loading branch information
cbosdo committed Nov 12, 2024
1 parent cc6bb5b commit 2a5d00b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mgradm/shared/templates/migrateScriptTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ $SSH {{ .SourceFqdn }} sh -c "systemctl list-unit-files | grep hub-xmlrpc-api |
echo "Altering configuration for domain resolution..."
sed 's/report_db_host = {{ .SourceFqdn }}/report_db_host = localhost/' -i /etc/rhn/rhn.conf;
sed 's/server\.jabber_server/java\.hostname/' -i /etc/rhn/rhn.conf;
if ! grep -q '^java.hostname *=' /etc/rhn/rhn.conf; then
sed 's/server\.jabber_server/java\.hostname/' -i /etc/rhn/rhn.conf;
fi
sed 's/client_use_localhost: false/client_use_localhost: true/' -i /etc/cobbler/settings.yaml;
echo "Altering configuration for container environment..."
Expand Down
1 change: 1 addition & 0 deletions uyuni-tools.changes.cbosdo.migration_fqdn_fix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Only add java.hostname on migrated server if not present

0 comments on commit 2a5d00b

Please sign in to comment.