Skip to content

Update uyuni_roster.conf when running spacewalk-hostname-rename#11456

Open
srbarrios wants to merge 1 commit intomasterfrom
change-salt-config-hostname-rename
Open

Update uyuni_roster.conf when running spacewalk-hostname-rename#11456
srbarrios wants to merge 1 commit intomasterfrom
change-salt-config-hostname-rename

Conversation

@srbarrios
Copy link
Member

@srbarrios srbarrios commented Feb 10, 2026

What does this PR change?

Add functionality to update uyuni_roster.conf, on the Salt Master configuration, with new hostname.

GUI diff

No difference.

  • DONE

Documentation

  • No documentation needed

  • DONE

Test coverage

ℹ️ If a major new functionality is added, it is strongly recommended that tests for the new functionality are added to the Cucumber test suite

  • No tests

  • DONE

Links

Issue(s): https://bugzilla.suse.com/show_bug.cgi?id=1257694
Port(s):

  • Manager-5.1

  • DONE

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Re-run a test

If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:

  • Re-run test "changelog_test"
  • Re-run test "backend_unittests_pgsql"
  • Re-run test "java_pgsql_tests"
  • Re-run test "schema_migration_test_pgsql"
  • Re-run test "susemanager_unittests"
  • Re-run test "frontend_checks"
  • Re-run test "spacecmd_unittests"

Before you merge

Check How to branch and merge properly!

@srbarrios srbarrios requested a review from cbosdo February 10, 2026 11:26
@srbarrios srbarrios self-assigned this Feb 10, 2026
Copy link
Contributor

@cbosdo cbosdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add a changelog entry, but the change looks good to me. Thanks for the fishx

Copy link
Contributor

@aaannz aaannz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is safe.
Imagine scenario people have multiple services on one host, like gitfs or what not which salt can be configured to use.
Then decide to move a uyuni server somewhere else and keep the rest.

With this you modify all salt configuration data, even though some of them should be kept as is.

I think modifying just uyuni_roster.conf is preferable.

@srbarrios srbarrios force-pushed the change-salt-config-hostname-rename branch 2 times, most recently from c8f0ddc to ca6bb53 Compare February 25, 2026 10:37
@srbarrios srbarrios marked this pull request as ready for review February 25, 2026 10:37
@srbarrios srbarrios changed the title Implement Salt configuration update for hostname change Update uyuni_roster.conf when running spacewalk-hostname-rename Feb 25, 2026
@srbarrios srbarrios force-pushed the change-salt-config-hostname-rename branch from 638e9a2 to fdc5459 Compare February 25, 2026 10:48
@srbarrios
Copy link
Member Author

I tested it changing from oscar-server to oscar-proxy my server hostname.
And it modified the file properly:

oscar-proxy:~ # mgradm server rename -c config.yaml
12:05PM INF Starting mgradm server rename -c config.yaml
12:05PM INF Use of this software implies acceptance of the End User License Agreement.
12:05PM INF Preparing SSL certificates to match the new hostname
12:05PM ERR Missing SANs or subjects in certificate of secret %!:(string=uyuni-cert) oscar-proxy.mgr.suse.de
12:05PM ERR Missing SANs or subjects in certificate of secret %!:(string=uyuni-db-cert) oscar-proxy.mgr.suse.de, db, reportdb
12:05PM INF Generating both the server and database certificates since one is missing
12:05PM INF Generating the server certificate…
12:05PM INF time="2026-02-25T12:05:26+01:00" level=warning msg="Path \"/etc/SUSEConnect\" from \"/etc/containers/mounts.conf\" doesn't exist, skipping"
time="2026-02-25T12:05:26+01:00" level=warning msg="Path \"/etc/zypp/credentials.d/SCCcredentials\" from \"/etc/containers/mounts.conf\" doesn't exist, skipping"
12:05PM INF Generate apache certificate...
12:05PM INF Generating the web server's SSL private key: /root/ssl-build/oscar-proxy.mgr/server.key

Generating web server's SSL certificate request: /root/ssl-build/oscar-proxy.mgr/server.csr
Using distinguished names:
    --set-country      = "DE"
    --set-state        = "Bayern"
    --set-city         = "Nuernberg"
    --set-org          = "SUSE"
    --set-org-unit     = "SUSE"
    --set-hostname     = "oscar-proxy.mgr.suse.de"
    --set-email        = ""

Generating/signing web server's SSL certificate: server.crt
12:05PM INF Server SSL certificate generated
12:05PM INF Generating the database certificate…
12:05PM INF time="2026-02-25T12:05:28+01:00" level=warning msg="Path \"/etc/SUSEConnect\" from \"/etc/containers/mounts.conf\" doesn't exist, skipping"
time="2026-02-25T12:05:28+01:00" level=warning msg="Path \"/etc/zypp/credentials.d/SCCcredentials\" from \"/etc/containers/mounts.conf\" doesn't exist, skipping"
12:05PM INF Generating DB certificate...
12:05PM INF Generating the web server's SSL private key: /root/ssl-build/reportdb/server.key
Rotated: server.key --> server.key.1
Rotated: rhn-server-openssl.cnf --> rhn-server-openssl.cnf.1

Generating web server's SSL certificate request: /root/ssl-build/reportdb/server.csr
Using distinguished names:
    --set-country      = "DE"
    --set-state        = "Bayern"
    --set-city         = "Nuernberg"
    --set-org          = "SUSE"
    --set-org-unit     = "SUSE"
    --set-hostname     = "reportdb"
    --set-email        = ""
Rotated: server.csr --> server.csr.1

Generating/signing web server's SSL certificate: server.crt
Rotated: server.crt --> server.crt.1
12:05PM INF Database SSL certificate generated
12:05PM INF Stopping the server container
12:05PM INF Changing the UYUNI_HOSTNAME to oscar-proxy.mgr.suse.de
12:05PM INF Starting the server container
12:05PM INF The renaming continues inside the server container.
The logs can be found in journalctl -u uyuni-config-update.service output.
oscar-proxy:~ # mgrctl term
===============================================================================
!
! This shell operates within a container environment, meaning that not all
! modifications will be permanently saved in volumes.
!
! Please exercise caution when making changes, as some alterations may not
! persist beyond the current session.
!
===============================================================================
uyuni-server:/ # cat /etc/salt/master.d/uyuni_roster.conf
ssh_run_pre_flight: true
uyuni_roster:
  host: oscar-proxy.mgr.suse.de

Copy link
Member

@mbussolotto mbussolotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add changelog, the other changes are fine

Add functionality to update Salt Master configuration files with new hostname.
@srbarrios srbarrios force-pushed the change-salt-config-hostname-rename branch from fdc5459 to 7b6274a Compare February 25, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants