From e182c3c04a513099f759d15b87d99b36c35ccf13 Mon Sep 17 00:00:00 2001 From: Mike Bell Date: Mon, 22 Apr 2024 10:51:21 +0100 Subject: [PATCH 1/3] Update move components runbook --- .../source/move-components-module.html.md.erb | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/runbooks/source/move-components-module.html.md.erb b/runbooks/source/move-components-module.html.md.erb index 676e6463..7102b0e1 100644 --- a/runbooks/source/move-components-module.html.md.erb +++ b/runbooks/source/move-components-module.html.md.erb @@ -10,18 +10,18 @@ review_in: 6 months 1. Raise PR with migrated module 2. Update #cloud-platform informing the team about the module migration and to not make new PRs against `cloud-platform-infrastructure`. 3. Pause pipelines -3. Log in to Concourse using `fly -t moj-cp login -c https://concourse.cloud-platform.service.justice.gov.uk/` -3. Ensure your in the `cloud-platform-terraform-concourse` directory. -3. Update pipelines with module name and cluster name: +4. Log in to Concourse using `fly -t moj-cp login -c https://concourse.cloud-platform.service.justice.gov.uk/` +5. Ensure your in the `cloud-platform-terraform-concourse` directory. +6. Update pipelines with module name and cluster name: `fly -t moj-cp set-pipeline --pipeline migrate-module --config migrate-module.yaml -v cluster_name=$CLUSTER_NAME -v module=$MODULE_NAME` -4. Run `migrate-module` pipeline from the Concourse UI. -5. Unpause pipelines -6. Re-run PR plan - the plan should show "No changes. Your infrastructure matches the configuration." -7. Pause pipelines -8. Get approval for the PR and merge. -9. Un-pause `live-2` and check for a clean apply -10. Repeat 9. with `manager` and `live` -11. Update #cloud-platform informing the team of the completed migration and that pipelines are unpaused. +7. Run `migrate-module` pipeline from the Concourse UI. +8. Unpause pipeline environment specific pipeline (e.g. live-2) +9. Re-run PR plan - the plan should show "No changes. Your infrastructure matches the configuration." +10. Re-run step 5-8 with the next environment (e.g. manager) +11. Get approval for the PR and merge. +12. Un-pause `live-2` and check for a clean apply +13. Repeat 9. with `manager` and `live` +14. Update #cloud-platform informing the team of the completed migration and that pipelines are unpaused. ## Disaster Recovery From f151df4a84156e485704e4243a45b4234d7448d6 Mon Sep 17 00:00:00 2001 From: Mike Bell Date: Mon, 22 Apr 2024 10:54:53 +0100 Subject: [PATCH 2/3] Ensure correct step number --- runbooks/source/move-components-module.html.md.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbooks/source/move-components-module.html.md.erb b/runbooks/source/move-components-module.html.md.erb index 7102b0e1..6a2932f6 100644 --- a/runbooks/source/move-components-module.html.md.erb +++ b/runbooks/source/move-components-module.html.md.erb @@ -17,7 +17,7 @@ review_in: 6 months 7. Run `migrate-module` pipeline from the Concourse UI. 8. Unpause pipeline environment specific pipeline (e.g. live-2) 9. Re-run PR plan - the plan should show "No changes. Your infrastructure matches the configuration." -10. Re-run step 5-8 with the next environment (e.g. manager) +10. Re-run step 5-9 with the next environment (e.g. manager) 11. Get approval for the PR and merge. 12. Un-pause `live-2` and check for a clean apply 13. Repeat 9. with `manager` and `live` From 7a5f30962a0c81b786a98cb0f4c126936597f674 Mon Sep 17 00:00:00 2001 From: Mike Bell Date: Mon, 22 Apr 2024 11:50:35 +0100 Subject: [PATCH 3/3] Added preface to module move runbook --- runbooks/source/move-components-module.html.md.erb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runbooks/source/move-components-module.html.md.erb b/runbooks/source/move-components-module.html.md.erb index 6a2932f6..bfea48d5 100644 --- a/runbooks/source/move-components-module.html.md.erb +++ b/runbooks/source/move-components-module.html.md.erb @@ -7,6 +7,14 @@ review_in: 6 months # Moving `components` modules into `core` +In order to migrate a terraform module from `components` into `core` there are a number of steps that need to be done in order to make sure the process runs smoothly. From a high level the terraform module needs to be moved and then tested in a test cluster. + +The aim is to make sure that when a terraform plan is run against both `core` and `compoents` after the MTM tool is ran there should be no terraform changes. + +There is a pipeline in Concourse that accepts `$CLUSTER_NAME` and `$MODULE_NAME` setting these and running the pipeline will migrate that module on the cluster specified. + +The exact steps should follow: + 1. Raise PR with migrated module 2. Update #cloud-platform informing the team about the module migration and to not make new PRs against `cloud-platform-infrastructure`. 3. Pause pipelines