Skip to content

fix(mgmt-server): use mgmt_server_router_id in frr.conf template - #626

Open
GeertJohan wants to merge 1 commit into
metal-stack:masterfrom
GeertJohan:fix-mgmt-server-router-id
Open

fix(mgmt-server): use mgmt_server_router_id in frr.conf template#626
GeertJohan wants to merge 1 commit into
metal-stack:masterfrom
GeertJohan:fix-mgmt-server-router-id

Conversation

@GeertJohan

@GeertJohan GeertJohan commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

It seems there is missing an underscore here but I'm not sure how it's gone unnoticed for 3 years?
Or perhaps routerid without underscore is preferred, but then three other files err by having the underscore.

@GeertJohan
GeertJohan requested a review from a team as a code owner June 15, 2026 21:21
@GeertJohan
GeertJohan requested a review from iljarotar June 15, 2026 21:21
@metal-robot metal-robot Bot added the area: deployment Affects the deployment area. label Jun 15, 2026
@iljarotar

Copy link
Copy Markdown
Contributor

In our deployments we use mgmt_server_routerid so this change would be breaking. I'd prefer adjusting the documentation and defaults instead of the template.

@GeertJohan

Copy link
Copy Markdown
Contributor Author

@iljarotar Do your configurations perhaps define the variable twice, with and without underscore? Because it seems like the role asserts the underscore-version MUST be set? https://github.com/metal-stack/metal-roles/blob/master/partition/roles/mgmt-server/tasks/main.yaml#L8

@GeertJohan
GeertJohan force-pushed the fix-mgmt-server-router-id branch from e2e6775 to bd7a0b7 Compare July 14, 2026 20:26
@GeertJohan

GeertJohan commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

It seems the linked assert always succeeds because

Fable 5:
Jinja's none test is just a Python value is None identity check, so an undefined variable passes is not none without error (the Undefined object is never actually touched, so it never raises — this holds even with StrictUndefined)

I've just pushed changes to fix the assert. Also implemented a backwards compatible move towards router_id, I thought it'd be nicer to have the proper spelling and cleanup elsewhere, but please let me know if you still prefer to stick with routerid then I'll move to that.

@GeertJohan
GeertJohan force-pushed the fix-mgmt-server-router-id branch from bd7a0b7 to 242085b Compare July 14, 2026 20:30
Comment thread partition/roles/mgmt-server/tasks/main.yaml Outdated
@GeertJohan
GeertJohan force-pushed the fix-mgmt-server-router-id branch 2 times, most recently from a8ef203 to fde9a86 Compare July 16, 2026 08:27
@Gerrit91

Gerrit91 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

To me these changes look good. If we add this breaking change to the release notes, it should be fairly easy to migrate (especially since you have this migration path in there). @iljarotar can you please take another look?

Comment on lines +14 to +21
- name: Deprecation warning for mgmt_server_routerid
run_once: true
print_message:
type: deprecate
msg: >-
The variable mgmt_server_routerid was renamed to mgmt_server_router_id.
action: Please define mgmt_server_router_id instead and remove the old variable.
when: mgmt_server_routerid is defined

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it make sense to throw an error in this case?

@iljarotar

Copy link
Copy Markdown
Contributor

Are we leaving the deprecated routerid in there so folks have time to adapt and are we planning to remove it in a later release? Actually, if we opt for introducing this breaking change I wouldn't mind just breaking it without a transition period. If someone uses the role and only defines routerid then the fixed assert will tell them what's wrong.

@GeertJohan

Copy link
Copy Markdown
Contributor Author

Sounds good @iljarotar , I'll make the change.

The frr.conf template was the only place using the spelling
mgmt_server_routerid, while the role's assert, README and defaults all
declare mgmt_server_router_id.

This went unnoticed because the mandatory variable assert never actually
enforced anything for undefined variables: 'foo is not none' evaluates
to true in Jinja when foo is undefined, so deployments defining only
mgmt_server_routerid passed the check all along.

The template now uses mgmt_server_router_id and the assert checks
'is defined and is not none' so it actually enforces the mandatory
variables. This is a breaking change for deployments that only define
mgmt_server_routerid: the fixed assert fails with a clear message until
the variable is renamed.

Generated-By: Claude Code Fable 5
@GeertJohan
GeertJohan force-pushed the fix-mgmt-server-router-id branch from 11602ff to 343d1ae Compare July 30, 2026 11:35
@GeertJohan

Copy link
Copy Markdown
Contributor Author

Rebased and squashed.

@iljarotar

iljarotar commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Please add a BREAKING_CHANGE notification in the PR description. This ensures that the breaking change is documented in the final release notes.

Looks like this:

## Release Notes

### Breaking Change

```BREAKING_CHANGE
Description of the breaking change and what an operator needs to do about it.
This section is **not** intended for documentation of internal breaking changes.
Release notes are meant to be read by users and operators of metal-stack, not metal-stack developers.
```

@iljarotar

Copy link
Copy Markdown
Contributor

/ok-to-build

@metal-robot metal-robot Bot mentioned this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: deployment Affects the deployment area.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants