Skip to content

[WIP] Move default server roles out of Settings#23717

Open
agrare wants to merge 1 commit intoManageIQ:masterfrom
agrare:move_server_role_default_from_settings_to_column
Open

[WIP] Move default server roles out of Settings#23717
agrare wants to merge 1 commit intoManageIQ:masterfrom
agrare:move_server_role_default_from_settings_to_column

Conversation

@agrare
Copy link
Member

@agrare agrare commented Feb 2, 2026

Add a :default column to ServerRole so that we do not need to use Settings.server.role to indicate if a role should be enabled by default or not.

This allows for plugins to bring default server roles.

Depends on:

Related:

end

def ensure_default_roles
MiqServer.my_server.add_settings_for_resource(:server => {:role => ENV["MIQ_SERVER_DEFAULT_ROLES"]}) if role.blank? && ENV["MIQ_SERVER_DEFAULT_ROLES"].present?
Copy link
Member Author

Choose a reason for hiding this comment

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

@miq-bot miq-bot added the wip label Feb 2, 2026
:limit: 5
:period: 20.seconds
:role: database_operations,event,reporting,scheduler,smartstate,ems_operations,ems_inventory,ems_metrics_collector,ems_metrics_coordinator,ems_metrics_processor,notifier,user_interface,remote_console,web_services,automate
:role:
Copy link
Member Author

Choose a reason for hiding this comment

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

This is replaced by ServerRole.default_roles

miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Feb 3, 2026
@agrare agrare force-pushed the move_server_role_default_from_settings_to_column branch from 1584fd3 to ddd8857 Compare February 3, 2026 19:30

def sync_assigned_roles
self.role = ::Settings.server.role
self.role = ::Settings.server.role if ::Settings.server.role
Copy link
Member Author

@agrare agrare Feb 3, 2026

Choose a reason for hiding this comment

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

::Settings.server.role can be nil now, not sure if we want to set ::Settings.server.role = server_role_names.join(",") or handle there not being any SettingsChanges for server.role

We still need to use Settings.server.role for the UI to configure roles for now at least.

@agrare agrare force-pushed the move_server_role_default_from_settings_to_column branch 3 times, most recently from e1c262c to 1e43936 Compare February 3, 2026 20:00
@agrare agrare force-pushed the move_server_role_default_from_settings_to_column branch from 1e43936 to 7f412b6 Compare February 3, 2026 20:02
@miq-bot
Copy link
Member

miq-bot commented Feb 3, 2026

Checked commit agrare@7f412b6 with ruby 3.3.10, rubocop 1.56.3, haml-lint 0.69.0, and yamllint
2 files checked, 0 offenses detected
Everything looks fine. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants