a43267532a
Why: - tofu apply fails with "Branch protection already exist" because the nine repos protected in #60 already have live branch protection in Gitea that is absent from Terraform state, so Terraform tries to create rules that already exist and Gitea rejects them. - The pinned go-gitea/gitea provider 0.7.0 defines no importer for gitea_repository_branch_protection, so the existing rules cannot be adopted on that version. How: - Bump the gitea provider from 0.7.0 to 0.8.1, which adds an importer for gitea_repository_branch_protection (id format <org>/<repo>/<rule_name>). - Add import blocks adopting the nine existing branch protections into state instead of recreating them.
253 lines
6.0 KiB
Terraform
253 lines
6.0 KiB
Terraform
import {
|
|
to = module.organisation["git.unkin.net/unkin"].gitea_org.this
|
|
id = "9"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/puppet-prod"].gitea_repository.this
|
|
id = "2"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/puppet-r10k"].gitea_repository.this
|
|
id = "3"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/rpmbuild-gonic"].gitea_repository.this
|
|
id = "23"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/docker-almalinux-base"].gitea_repository.this
|
|
id = "24"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/rpmbuild-internal-ca-certificates"].gitea_repository.this
|
|
id = "27"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/rpmbuild-template"].gitea_repository.this
|
|
id = "29"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/rpmbuild-jellyfin-web"].gitea_repository.this
|
|
id = "31"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/rpmbuild-proxlb"].gitea_repository.this
|
|
id = "33"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/docker-almalinux-buildrunner"].gitea_repository.this
|
|
id = "36"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/docker-template"].gitea_repository.this
|
|
id = "38"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/terraform-vault"].gitea_repository.this
|
|
id = "39"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/docker-almalinux-jupyterinstance"].gitea_repository.this
|
|
id = "40"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/rpmbuilder"].gitea_repository.this
|
|
id = "41"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/docker-almalinux-runnerdnd"].gitea_repository.this
|
|
id = "43"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/initbuilder"].gitea_repository.this
|
|
id = "47"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/puppetapi"].gitea_repository.this
|
|
id = "50"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/terraform-nomad"].gitea_repository.this
|
|
id = "53"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/packer-images"].gitea_repository.this
|
|
id = "59"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/app-sudaporn-research-normalised"].gitea_repository.this
|
|
id = "60"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/app-sudaporn-research-individual"].gitea_repository.this
|
|
id = "63"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/terraform-incus"].gitea_repository.this
|
|
id = "66"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/artifactapi"].gitea_repository.this
|
|
id = "67"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/argocd-apps"].gitea_repository.this
|
|
id = "100"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/certmanager"].gitea_repository.this
|
|
id = "101"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/node-lookup"].gitea_repository.this
|
|
id = "102"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/container-devcompute"].gitea_repository.this
|
|
id = "135"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/streamstack"].gitea_repository.this
|
|
id = "136"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/terraform-provider-artifactapi"].gitea_repository.this
|
|
id = "137"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/forgebot"].gitea_repository.this
|
|
id = "139"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/forgebot-skills"].gitea_repository.this
|
|
id = "140"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/container-agent-base"].gitea_repository.this
|
|
id = "141"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/container-agent-dev"].gitea_repository.this
|
|
id = "142"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/container-agent-infra"].gitea_repository.this
|
|
id = "143"
|
|
}
|
|
|
|
import {
|
|
to = module.team["git.unkin.net/unkin/Owners"].gitea_team.this
|
|
id = "3"
|
|
}
|
|
|
|
import {
|
|
to = module.team["git.unkin.net/unkin/docker"].gitea_team.this
|
|
id = "5"
|
|
}
|
|
|
|
import {
|
|
to = module.team["git.unkin.net/unkin/rpmbuild"].gitea_team.this
|
|
id = "6"
|
|
}
|
|
|
|
import {
|
|
to = module.team["git.unkin.net/unkin/puppet"].gitea_team.this
|
|
id = "7"
|
|
}
|
|
|
|
import {
|
|
to = module.team["git.unkin.net/unkin/pybuild"].gitea_team.this
|
|
id = "9"
|
|
}
|
|
|
|
import {
|
|
to = module.team["git.unkin.net/unkin/terraform"].gitea_team.this
|
|
id = "12"
|
|
}
|
|
|
|
import {
|
|
to = module.repository["git.unkin.net/unkin/terraform-git"].gitea_repository.this
|
|
id = "144"
|
|
}
|
|
|
|
# Branch protections that already exist in Gitea but are not yet in state.
|
|
# Import id format is <organisation>/<repository>/<rule_name>.
|
|
import {
|
|
to = module.branch_protection["git.unkin.net/unkin/app-sudaporn-research-individual/master"].gitea_repository_branch_protection.this
|
|
id = "unkin/app-sudaporn-research-individual/master"
|
|
}
|
|
|
|
import {
|
|
to = module.branch_protection["git.unkin.net/unkin/app-sudaporn-research-normalised/master"].gitea_repository_branch_protection.this
|
|
id = "unkin/app-sudaporn-research-normalised/master"
|
|
}
|
|
|
|
import {
|
|
to = module.branch_protection["git.unkin.net/unkin/benvin-utils/main"].gitea_repository_branch_protection.this
|
|
id = "unkin/benvin-utils/main"
|
|
}
|
|
|
|
import {
|
|
to = module.branch_protection["git.unkin.net/unkin/container-devcompute/main"].gitea_repository_branch_protection.this
|
|
id = "unkin/container-devcompute/main"
|
|
}
|
|
|
|
import {
|
|
to = module.branch_protection["git.unkin.net/unkin/docker-template/master"].gitea_repository_branch_protection.this
|
|
id = "unkin/docker-template/master"
|
|
}
|
|
|
|
import {
|
|
to = module.branch_protection["git.unkin.net/unkin/initbuilder/main"].gitea_repository_branch_protection.this
|
|
id = "unkin/initbuilder/main"
|
|
}
|
|
|
|
import {
|
|
to = module.branch_protection["git.unkin.net/unkin/puppetapi/master"].gitea_repository_branch_protection.this
|
|
id = "unkin/puppetapi/master"
|
|
}
|
|
|
|
import {
|
|
to = module.branch_protection["git.unkin.net/unkin/rpmbuild-internal-ca-certificates/master"].gitea_repository_branch_protection.this
|
|
id = "unkin/rpmbuild-internal-ca-certificates/master"
|
|
}
|
|
|
|
import {
|
|
to = module.branch_protection["git.unkin.net/unkin/streamstack/main"].gitea_repository_branch_protection.this
|
|
id = "unkin/streamstack/main"
|
|
}
|
|
|