SUSE Multi-Linux Manager 5.1: change FQDN

When migrating from SUSE Manager 4.3 to SUSE Multi-Linux Manager 5.x, the IP address and FQDN are usually carried over, or corresponding aliases to the new system are created via PTR records. In some circumstances, however, this is either undesirable or not possible.

The mgradm server rename command was created for this purpose (see also the Multi-Linux Manager and Uyuni documentation):

1# hostnamectl set-hostname newserver.hurrdurr.biz
2# mgradm server rename

The command replaces instances of the name in many places (in some configuration files and in the database); however, it overlooks a few files, which then need to be updated in a mgrctl term session.

/etc/rhn/rhn.conf:

1java.hostname = newserver.hurrdurr.biz
2osa-dispatcher.jabber_server = newserver.hurrdurr.biz
3web.default_mail_from = SUSE Multi-Linux Manager (newserver.hurrdurr.biz) <root@hurrdurr.biz>

/etc/cobbler/settings.yaml:

1redhat_management_server: newserver.hurrdurr.biz
2server: newserver.hurrdurr.biz
Notice

It wouldn't hurt to do a quick search using fgrep in other configuration files under /etc.

Unfortunately, the Salt Pillars stored in the database also need to be updated. As a result, running the Highstate on the systems causes problems.

On the one hand, the manually adjusted configuration of the Salt minion (/etc/venv-salt-minion/minion.d/susemanager.conf) is reset, but the package manager’s configuration is also set incorrectly.

This can be resolved by manually updating the references. To do this, an interactive shell is required within the database container.

1# podman exec -ti uyuni-db bash
2# psql -U susemanager -d susemanager --host db

The following query lists all entries with an outdated FQDN:

1suma=# SELECT id, server_id FROM susesaltpillar WHERE pillar::text LIKE '%oldserver.hurrdurr.biz%';
2id | server_id
3----+------------
413 | 1000010023
537 | 1000010042
6...

An entry for a specific profile is corrected as follows (thanks a lot for pointing out, Ralph!):

1UPDATE susesaltpillar
2SET pillar = regexp_replace(
3    regexp_replace(
4        regexp_replace(pillar::text, '"host": "oldserver.hurrdurr.biz"', '"host": "newserver.hurrdurr.biz"', 'g'),
5    '"mgr_server": "oldserver.hurrdurr.biz"', '"mgr_server": "newserver.hurrdurr.biz"', 'g'),
6'"mgr_origin_server": "oldserver.hurrdurr.biz"', '"mgr_origin_server": "newserver.hurrdurr.biz"', 'g')::jsonb
7WHERE id = 13;

This call must be repeated for all affected profiles – the relevant identifier (id) must be updated accordingly. Once updated, the pillar of the Minion must be checked:

1# salt myclient saltutil.pillar_refresh
2# salt myclient pillar.item mgr_server mgr_origin_server
3myclient:
4    ----------
5    mgr_origin_server:
6        newserver.hurrdurr.biz
7    mgr_server:
8        newserver.hurrdurr.biz

The highstate can then be applied again.

Translations: