Issue
CloudBees CI Teams on the operations center are deprecated, and I want to convert existing Team controllers to Managed controllers.
|
Environment
-
CloudBees CI on modern cloud platforms - team controller- version 2.541.1.35570
Process
| Before beginning this migration, you must upgrade to CloudBees CI version 2.541.1.35570 or later, as this procedure has only been tested with CloudBees CI version 2.541.1.35570. |
Operations center preparation
| This step only needs to be completed once for the Operations center. |
Create Role-Based Access Control roles
|
With Role-Based Access Control (RBAC), it is not possible to grant the Overall/ADMINISTER permission to a user to manage a specific controller, without the user being able to edit the controller configuration in the operations center. To allow Team Admins to administer their controller without being able to execute arbitrary code inside the controller, the Overall Manage permission can be used. If Team admins can be trusted to edit controller configurations in the operations center, then the Overall/ADMINISTER permission can be used instead, and the Team Admin (Trusted) permission can be used in place of the two other Team Admin Roles. |
Create Roles in CloudBees RBAC to replicate the team controller roles. Refer to Configure and manage roles to create the following roles:
| Role | Permissions |
|---|---|
Team Admin |
|
Team Admin |
|
Team Admin |
|
Team member |
|
Team Viewer |
|
Migrate the controller
In the operations center:
-
Navigate to the Team controller configuration page and copy the group membership.
-
Navigate to the dashboard of your operations center.
-
Select the gear icon for managing the team controller. If it is not present, first navigate to the Teams` folder.
-
Select Groups to edit the groups on the controller.
-
Create a new group called
<teamname>-adminsand grant Team Admin (untrusted OC) at the current level and Team Admin (untrusted controller) at the child level, with Propagates selected for both roles. -
Add the users that previously had the Team Admin role.
-
Edit the controller configuration in the Operations center, in the in the System Properties field remove the following properties (if they exist) (cb.BeekeeperProp.autoInstallIncremental, cb.BeekeeperProp.noFullUpgrade, cb.IMProp.warProfiles) then add
BLUE_ORGANIZATION_ROOT_FOLDER=<name-of-team-folder>(replace<name-of-team-folder>with the folder name found at the root of the controller, which will be based upon the name of the controller). -
Save the configuration.
-
Deprovision the controller.
-
In the script console of Operations center, run the following script after replacing
teamnamewith the name of your team controller:import com.cloudbees.opscenter.server.bluesteel.ConnectedMasterTeamProperty import java.nio.file.Files def controller = Jenkins.get().getItemByFullName("teams/teamname") if (controller != null) { controller.getProperties().remove(ConnectedMasterTeamProperty.class) Files.deleteIfExists(controller.getRootDir().toPath().resolve("team.xml")) Files.deleteIfExists(controller.getRootDir().toPath().resolve("teamSecurity.xml")) println "Operation was successful" } else { println "Error: Controller was not found" } -
Start the managed controller.
On the managed controller:
-
Run the following script in the script console of the managed controller after updating
teamnameto be the name of your team controller folder:import com.cloudbees.opscenter.bluesteel.folder.BlueSteelTeamFolder import java.nio.file.Files def tf = Jenkins.get().getItemByFullName("teamname", BlueSteelTeamFolder.class) if (tf == null) { println "Error: Team folder not found" return } def configPath = tf.getRootDir().toPath().resolve("config.xml") if (configPath == null || !Files.exists(configPath)) { println "Error: Config file not found" return } String configXml = Files.readString(configPath) configXml = configXml.replace("com.cloudbees.opscenter.bluesteel.folder.BlueSteelTeamFolder", "com.cloudbees.hudson.plugins.folder.Folder") Files.writeString(configPath, configXml) Jenkins.get().save() Jenkins.get().reload() println "Operation was successful" -
Navigate to the teamname folder, and then select Groups.
-
Create a new group called teamname-members and grant it the Team members role, with Propagates enabled.
-
Add the users that previously had the Team Member role.
-
Create a new group called teamname-viewers and grant it the Team viewers role, with Propagates enabled. Add the users that previously had the Team Viewer role.
-
If you had any custom Teams roles defined for this team, create a separate group for each custom role. The role must be created in the operations center. Refer to Restrict access and delegate administration with Role-Based Access Control for more information.
-
Navigate to the plugin manager and uninstall the following plugins:
-
CloudBees CI Teams on Controller
-
CloudBees Blue Ocean Default Theme
Blue Ocean will be removed from the CAP and will no longer be tested or supported. CloudBees recommends that you uninstall all Blue Ocean plugins from the managed controller and use CloudBees Pipeline Explorer for pipeline visualization. Doing so will allow you to take advantage of the latest features including HA/HS for controllers.
-
-
Restart the managed controller.
-
When the managed controller is back online, check to validate the controller is using the desired security settings.
-
Now that the migration is complete, consider uninstalling plugins that are likely no longer required, plugins that are deprecated, and community plugins that were part of team controllers or were dependencies of those plugins:
-
CloudBees Fast Archiving Plugin (
cloudbees-jsync-archiver-plugin) -
CloudBees WikiText Plugin (
wikitext-plugin) -
Git server Plugin (
git-server-plugin) -
GitHub Organization Folder Plugin (
github-organization-folder-plugin) -
Operations Center Analytics Configuration (
operations-center-analytics-config) -
Operations Center Analytics Reporter (
operations-center-analytics-reporter) -
Pipeline: Deprecated Groovy Libraries (
workflow-cps-global-lib-plugin)
-
Post-migration steps
Once all team controllers have been either converted or migrated, the CloudBees CI Teams on Operations center plugin can be uninstalled from the operations center. Refer to Uninstall plugins from CloudBees CI.