deleting an organization from rhaap
15-08-2025 Code update
Pipeline check was failing when the gitlab_group contained subgroups group/subgroup, the gitlab api wants '%2F', this is now automaticly converted, where appropiate.
This playbook, removes a defined organization from rhaap.
It removes a organization using almost the same code as creating an organization, running in
reverse order.
It uses 5 phases to accomplish this:
1- Disable the pipeline on the config as code team repository
2- For gateway set all definitions for the organization "absent", run the pipeline
3- Cleanup the Config as code files for gateway, removing the now obsolete items
4- Cleanup credential mappings for the organization in base controller configuration
5- Cleanup stale items from controller, wich are not removed after removing the organization. And disable the organizations repository pipeline.
The survey will only ask for the short_team_name, this is all the play needs to function.
The pipelines are run against the development environment at this time, it has to run against all defined environments for each phase.
dependencies
This playbook depends on the gitlab_mgt_automation based credential, this needs to be added to the job_template.
Phase 1
As we leave the config as code repository for later use, we disable the pipeline on it.
So it can't run anymore.
Phase 2
Checkout rhaap base configuration into temp directory.
Update rhaap configuration, so all organization data has state 'absent'.
Push the update into git and run the pipeline to remove the organization.
Wait for the pipeline to finish.
Phase 3
Clean the yaml files in the rhaap base config as if the organization never existed.
Push the updated files into GIT.
Remove temp directory
Phase 4
Remove projects, workflow_templates and job_templates that remain after removing the organization.
Disable the pipeline on the CaC repository of the team.
The organization is now removed and no longer accessible.
Status
Completed