51 Commits

Author SHA1 Message Date
benvin 85057e02d8 Merge pull request 'Add jellyfin-ha container-build repo' (#24) from benvin/jellyfin-ha into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #24
2026-07-05 22:42:33 +10:00
unkinben 6a159dc06f Add jellyfin-ha container-build repo
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
Adds the Gitea repository that manages the Docker container build for the
jellyfin-ha (HA transcoding) Jellyfin fork.

- Create unkin/jellyfin-ha (public, squash merges, delete branch on merge)
- Protect main; require the ci/woodpecker/pr/build check and docker-team approval
2026-07-05 22:26:06 +10:00
benvin 2f794b2e9b Merge pull request 'chore: reset default owners' (#23) from benvin/merge-approval into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #23
2026-07-05 16:40:41 +10:00
unkinben d51bfe055b chore: reset default owners
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
change whitelist approval list to use benvin via oidc instead of gitea
local account unkinben
2026-07-05 15:47:20 +10:00
benvin b278be072d Merge pull request 'add encapi and terraform-provider-encapi repos' (#22) from benvin/add-encapi-repos into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #22
2026-07-04 23:39:49 +10:00
unkinben 96f2fc0302 add encapi and terraform-provider-encapi repos
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
Create the two Gitea repos backing the new Puppet ENC that replaces Cobbler:
- encapi: Go API + encapi-cli, Postgres-backed
- terraform-provider-encapi: Terraform provider for ENC roles/statuses/nodes

Both use main as default branch with squash-merge, delete-branch-after-merge,
and branch protection gated on the PR pipelines (pre-commit, test, build).
2026-07-04 23:21:27 +10:00
benvin c2a84ecd83 Merge pull request 'Enable delete-branch-after-merge on all repos' (#21) from benvin/delete-branch-after-merge-all into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #21
2026-07-04 23:14:28 +10:00
benvin 6b26a75149 Merge branch 'main' into benvin/delete-branch-after-merge-all
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
2026-07-04 23:12:34 +10:00
benvin da36708a15 Merge pull request 'Switch node-lookup repo to a main default branch' (#20) from benvin/node-lookup-main-branch into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #20
2026-07-04 23:07:27 +10:00
unkinben bbfe0edf2f Enable delete-branch-after-merge on all repos
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
Merged PR branches should be cleaned up automatically everywhere, for a
consistent workflow across the estate.

- Flip default_delete_branch_after_merge from false to true on the 10 repos
  that had it disabled.
- Add default_delete_branch_after_merge: true to the 3 repos that were missing
  the field (terraform-git, terraform-provider-litellmvaultsecret,
  vault-plugin-secrets-litellm).
2026-07-04 22:52:02 +10:00
unkinben 844fff8db6 Switch node-lookup repo to a main default branch
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
node-lookup is being set up with build/test/pre-commit CI and a main-based
workflow, so its Gitea repo config needs to match.

- Change default_branch from master to main.
- Rename the branch protection rule to main and update the required status
  checks to the new pipeline names (build, test, pre-commit) instead of the
  old lint/unit-tests contexts.
2026-07-04 22:50:52 +10:00
benvin 7bf810210f Merge pull request 'Add bind-operator repository' (#19) from benvin/add-bind-operator-repo into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #19
2026-07-03 15:24:22 +10:00
unkinben a4967d0bbf Add bind-operator repository
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
Declares the bind-operator repo so Gitea provisions it for the new
Kubernetes operator that manages BIND9 DNS clusters.

- add config/git.unkin.net/unkin/repository/bind-operator.yaml with
  main as default branch, squash merge, delete-branch-after-merge, and
  branch protection requiring the pre-commit/test/build CI checks
2026-07-03 15:22:58 +10:00
benvin 773f734d8e Merge pull request 'Add vault-plugin-secrets-litellm and terraform-provider-litellm repos' (#18) from benvin/add-litellm-repos into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #18
2026-07-02 23:17:05 +10:00
unkinben 4495339979 Rename provider repo to terraform-provider-litellmvaultsecret
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
Use a more specific name that reflects this is the Terraform provider for the
LiteLLM Vault/OpenBao secrets engine, not for LiteLLM itself.
2026-07-02 23:05:19 +10:00
benvin d59d1244f3 Merge pull request 'Add tomswall repository' (#17) from benvin/add-tomswall-repo into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #17
2026-07-02 23:02:06 +10:00
unkinben 043e73424c Add vault-plugin-secrets-litellm and terraform-provider-litellm repos
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
Provision two new Gitea repos for the LiteLLM dynamic secrets work: the
Vault/OpenBao secrets-engine plugin and its companion Terraform provider.

- Add config/.../repository/vault-plugin-secrets-litellm.yaml
- Add config/.../repository/terraform-provider-litellm.yaml
- Default branch main, squash-only merging (allow_* flags, since the
  go-gitea/gitea provider has no default_merge_style), and branch protection
  on main requiring pre-commit/build/test checks with Owners approval
2026-07-02 22:57:34 +10:00
unkinben 5cfbf60f65 Add branch protection for tomswall main branch
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
2026-06-29 23:23:45 +10:00
unkinben dfbb90a7dc Add tomswall repository definition
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
New Go project for an nftables firewall manager — spiritual successor
to shorewall using google/nftables for direct kernel interaction.
2026-06-28 23:42:34 +10:00
benvin d1d00e5c47 Merge pull request 'feat: add terraform-sonarr, terraform-radarr, terraform-prowlarr repos' (#16) from feat/add-media-terraform-repos into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #16
2026-06-28 22:00:53 +10:00
unkinben 93175707eb feat: add terraform-sonarr, terraform-radarr, terraform-prowlarr repos
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
2026-06-28 21:58:59 +10:00
benvin a5d4b881a5 Merge pull request 'Add terraform-authentik repository' (#15) from benvin/add-terraform-authentik into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #15
2026-06-28 00:59:19 +10:00
unkinben a8d22b743a Add terraform-authentik repository
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
Create Gitea repo for managing Authentik identity provider configuration via Terraform.
2026-06-28 00:57:07 +10:00
benvin eedb415419 Merge pull request 'feat: add age-api repo' (#14) from benvin/ageapi into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #14
2026-06-27 23:27:40 +10:00
unkinben 0a3700db7a feat: add age-api repo
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
2026-06-27 23:18:24 +10:00
benvin 5a04fb4b22 Merge pull request 'feat: add required checks to terraform-provider-artifactapi' (#13) from benvin/build-check into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #13
2026-06-21 22:34:28 +10:00
unkinben f4b3f9cd08 feat: add required checks to terraform-provider-artifactapi
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
ensure the pre-commit, build and test ci tasks are performed in CI
2026-06-21 22:28:01 +10:00
benvin 1469866329 Merge pull request 'chore: change default branch to main' (#12) from benvin/default_main into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #12
2026-06-17 19:49:39 +10:00
unkinben b1684b7cf8 chore: change default branch to main
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
- update terraform-artifactapi default branch
2026-06-17 19:47:12 +10:00
unkinben 5cd6659f59 Merge pull request 'feat: add branch protection' (#11) from benvin/branch_protection into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #11
2026-06-13 14:50:43 +10:00
unkinben e000c1132f feat: add branch protection
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
- add branch protection rules for docker repos
2026-06-13 14:49:17 +10:00
benvin af26cee479 Merge pull request 'Remove woodpecker module and fix branch protection dependency' (#10) from benvin/remove-woodpecker-module into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #10
2026-06-12 22:34:57 +10:00
unkinben 85583a02ad Remove woodpecker module and fix branch protection dependency
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
- Remove woodpecker_repository module and provider (repos managed outside TF)
- Add removed block with destroy=false to drop state without destroying
- Add module.team to branch_protection depends_on to prevent race condition
- Add lifecycle ignore_changes for team permission (provider bug: API returns
  "none" but rejects it on write)
2026-06-12 22:26:19 +10:00
benvin 3744ecd09f Merge pull request 'feat: return to make-apply' (#8) from benvin/always-apply into main
ci/woodpecker/push/apply Pipeline failed
Reviewed-on: #8
2026-06-12 22:01:25 +10:00
benvin 353d310bc8 Merge pull request 'feat: add terraform-artifactapi repository' (#9) from feat/add-terraform-artifactapi into main
ci/woodpecker/push/apply Pipeline failed
Reviewed-on: #9
2026-06-12 21:59:45 +10:00
unkinben 571a9b2149 feat: add terraform-artifactapi repository
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
Create the Gitea repo with branch protection on master requiring
pre-commit and plan CI checks before merge.
2026-06-12 21:56:46 +10:00
unkinben dd31dc916c feat: return to make-apply
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
- always make-apply on merge to main
2026-06-12 01:10:19 +10:00
benvin 5afa850e45 Merge pull request 'Enable branch protection and Woodpecker for forgebot repos' (#7) from fix/forgebot-branch-protection into main
ci/woodpecker/push/apply Pipeline failed
Reviewed-on: #7
2026-06-12 00:47:15 +10:00
unkinben 236a94337a Enable branch protection and Woodpecker for forgebot repos
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
- Add forgebot team with unkinben and benvin members
- Enable branch protection on main for forgebot and forgebot-skills
- Team-based approval and merge whitelists
- Register both repos with Woodpecker CI
- CI status checks: pre-commit, test, build (forgebot); validate (skills)
2026-06-12 00:45:39 +10:00
benvin 6b14486e5e Merge pull request 'feat: import forgebot and container-agent repos' (#5) from feat/import-new-repos into main
ci/woodpecker/push/apply Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
Reviewed-on: #5
2026-06-12 00:35:31 +10:00
unkinben 99e2b124a6 feat: import forgebot and container-agent repos
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
2026-06-12 00:33:58 +10:00
unkinben bd60fb3669 Add forgebot and forgebot-skills repos with branch protection
- forgebot: branch protection on main with pre-commit, test, build CI checks
- forgebot-skills: branch protection on main with validate CI check
- Both repos enabled for Woodpecker CI
2026-06-12 00:32:57 +10:00
benvin e5a69ea953 Merge pull request 'feat: only run apply when plan detects changes' (#4) from feat/conditional-apply into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #4
2026-06-11 23:32:01 +10:00
unkinben dc9f3cd595 fix: remove unused deploy_key variable and duplicate required_providers
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
2026-06-11 23:30:23 +10:00
unkinben 883faee35c style: tofu fmt alignment
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline failed
2026-06-11 23:28:02 +10:00
unkinben 8e3eac286c feat: add make pre-commit target
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline failed
2026-06-11 23:26:29 +10:00
unkinben 6203e4d0e2 fix: add terraform.tf for pre-commit validation
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline failed
Required for tofu-validate and tflint to work standalone
without the terragrunt-generated backend.tf.
2026-06-11 23:25:32 +10:00
unkinben 1b127941f8 feat: add terraform-git
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline was successful
- add new repo
- change write -> none
2026-06-11 23:23:29 +10:00
unkinben 1a5921d9b0 feat: only run apply when plan detects changes
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline was successful
2026-06-11 23:21:51 +10:00
benvin 148a9f4962 Merge pull request 'feat: initial terraform-git configuration' (#1) from feat/initial-config into main
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #1
2026-06-11 00:23:16 +10:00
unkinben c87b3ac471 feat: initial terraform-git project
Manage Gitea resources via Terraform/Terragrunt with YAML-driven config.

Resources managed:
- Organisation (unkin)
- 28 repositories with settings
- 6 teams with members
- 13 branch protection rules
- 9 Woodpecker CI repo activations
- Deploy key module (ready, no keys yet)

Config structure: config/<service>/<org>/<type>/<object>.yaml
Consul backend for state, Vault for auth tokens.
2026-06-10 23:45:41 +10:00
84 changed files with 1672 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
.terraform
.terraform.lock.hcl
env
.terragrunt-cache
+24
View File
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
types: [yaml]
- id: trailing-whitespace
types: [yaml]
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.30
hooks:
- id: tofu-fmt
- id: tofu-validate
- id: tflint
- id: terragrunt-hcl-fmt
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.37.1
hooks:
- id: yamllint
args:
[
"-d {extends: relaxed, rules: {line-length: disable}, ignore: chart}",
"-s",
]
+22
View File
@@ -0,0 +1,22 @@
when:
- event: push
branch: main
steps:
- name: apply
image: git.unkin.net/unkin/almalinux9-opentofu:20260606
environment:
VAULT_AUTH_METHOD: kubernetes
commands:
- dnf install vault -y
- make apply
backend_options:
kubernetes:
serviceAccountName: terraform-git
resources:
requests:
memory: 512Mi
cpu: 1
limits:
memory: 2Gi
cpu: 2
+21
View File
@@ -0,0 +1,21 @@
when:
- event: pull_request
steps:
- name: plan
image: git.unkin.net/unkin/almalinux9-opentofu:20260606
environment:
VAULT_AUTH_METHOD: kubernetes
commands:
- dnf install vault -y
- make plan
backend_options:
kubernetes:
serviceAccountName: terraform-git
resources:
requests:
memory: 512Mi
cpu: 1
limits:
memory: 2Gi
cpu: 2
+18
View File
@@ -0,0 +1,18 @@
when:
- event: pull_request
steps:
- name: pre-commit
image: git.unkin.net/unkin/almalinux9-opentofu:20260606
commands:
- uvx pre-commit run --all-files
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 512Mi
cpu: 1
limits:
memory: 2Gi
cpu: 2
+52
View File
@@ -0,0 +1,52 @@
.PHONY: init plan apply apply-if-changes format pre-commit
VAULT_AUTH_METHOD ?= approle
VAULT_K8S_ROLE ?= woodpecker_terraform_git
VAULT_K8S_MOUNT ?= auth/k8s/au/syd1
VAULT_K8S_JWT_PATH ?= /var/run/secrets/kubernetes.io/serviceaccount/token
define vault_env
@export VAULT_ADDR="https://vault.service.consul:8200" && \
if [ "$(VAULT_AUTH_METHOD)" = "kubernetes" ]; then \
export VAULT_TOKEN=$$(vault write -field=token $(VAULT_K8S_MOUNT)/login role=$(VAULT_K8S_ROLE) jwt=$$(cat $(VAULT_K8S_JWT_PATH))); \
else \
export VAULT_TOKEN=$$(vault write -field=token auth/approle/login role_id=$$VAULT_ROLEID); \
fi && \
export CONSUL_HTTP_TOKEN=$$(vault read -field=token consul_root/au/syd1/creds/terraform-git) && \
export GITEA_TOKEN=$$(vault kv get -field=token kv/service/gitea/gitadmin/tokens/terraform-git) && \
export WOODPECKER_TOKEN=$$(vault kv get -field=token kv/service/woodpecker/tokens/gitadmin)
endef
init:
@$(call vault_env) && \
terragrunt run --all --non-interactive init -- -upgrade
plan: init
@$(call vault_env) && \
terragrunt run --all --parallelism 4 --non-interactive plan
apply-if-changes: init
@$(call vault_env) && \
terragrunt run --all --parallelism 4 --non-interactive plan -- -detailed-exitcode -out=tfplan; \
EXIT_CODE=$$?; \
if [ $$EXIT_CODE -eq 2 ]; then \
$(call vault_env) && \
terragrunt run --all --parallelism 2 --non-interactive apply -- tfplan; \
elif [ $$EXIT_CODE -eq 0 ]; then \
echo "No changes detected, skipping apply."; \
else \
exit $$EXIT_CODE; \
fi
apply: init
@$(call vault_env) && \
terragrunt run --all --parallelism 2 --non-interactive apply
format:
@echo "Formatting OpenTofu files..."
@tofu fmt -recursive .
@echo "Formatting Terragrunt files..."
@terragrunt hcl fmt
pre-commit:
@uvx pre-commit run --all-files
+58
View File
@@ -0,0 +1,58 @@
locals {
config_files = fileset(".", "**/*.yaml")
all_configs = {
for file_path in local.config_files :
file_path => yamldecode(file(file_path))
}
config = {
organisation = {
for file_path, content in local.all_configs :
trimsuffix(replace(file_path, "/config.yaml", ""), ".yaml") => merge(content, {
name = split("/", file_path)[1]
gitea_url = split("/", file_path)[0]
})
if endswith(file_path, "/config.yaml") && length(split("/", file_path)) == 3
}
repository = {
for file_path, content in local.all_configs :
"${split("/", file_path)[0]}/${split("/", file_path)[1]}/${trimsuffix(basename(file_path), ".yaml")}" => merge(content, {
name = trimsuffix(basename(file_path), ".yaml")
organisation = split("/", file_path)[1]
gitea_url = split("/", file_path)[0]
})
if length(regexall("/repository/", file_path)) > 0
}
team = {
for file_path, content in local.all_configs :
"${split("/", file_path)[0]}/${split("/", file_path)[1]}/${trimsuffix(basename(file_path), ".yaml")}" => merge(content, {
name = trimsuffix(basename(file_path), ".yaml")
organisation = split("/", file_path)[1]
gitea_url = split("/", file_path)[0]
})
if length(regexall("/team/", file_path)) > 0
}
branch_protection = merge([
for file_path, content in local.all_configs : {
for idx, rule in try(content.branch_protection, []) :
"${split("/", file_path)[0]}/${split("/", file_path)[1]}/${trimsuffix(basename(file_path), ".yaml")}/${rule.rule_name}" => merge(rule, {
repository = trimsuffix(basename(file_path), ".yaml")
organisation = split("/", file_path)[1]
gitea_url = split("/", file_path)[0]
})
}
if length(regexall("/repository/", file_path)) > 0
]...)
deploy_key = {
for file_path, content in local.all_configs :
"${split("/", file_path)[0]}/${split("/", file_path)[1]}/${split("/", replace(file_path, "deploy_key/", ""))[2]}/${trimsuffix(basename(file_path), ".yaml")}" => merge(content, {
title = trimsuffix(basename(file_path), ".yaml")
repository = split("/", replace(file_path, "deploy_key/", ""))[2]
organisation = split("/", file_path)[1]
gitea_url = split("/", file_path)[0]
})
if length(regexall("/deploy_key/", file_path)) > 0
}
}
}
+3
View File
@@ -0,0 +1,3 @@
description: ""
visibility: public
repo_admin_change_team_access: true
@@ -0,0 +1,16 @@
description: "Simple API for showing a users age"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/test"
- "ci/woodpecker/pr/build"
approval_whitelist_teams:
- "Owners"
merge_whitelist_teams:
- "Owners"
@@ -0,0 +1,4 @@
description: "Sudaporn's Research Data visualisation, normalised "
private: false
default_branch: "master"
default_delete_branch_after_merge: true
@@ -0,0 +1,4 @@
description: "Sudaporn's Research Data visualisation, normalised"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
@@ -0,0 +1,12 @@
description: "GitOps for ArgoCD"
private: false
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/kubeconform"
approval_whitelist_users:
- "benvin"
@@ -0,0 +1,14 @@
description: "My terrible vibe coded artifact cache"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "master"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/test"
- "ci/woodpecker/pr/build"
approval_whitelist_users:
- "benvin"
@@ -0,0 +1,14 @@
description: "Kubernetes operator for managing BIND9 DNS clusters, zones, views, and TSIG keys"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/test"
- "ci/woodpecker/pr/build"
approval_whitelist_teams:
- "Owners"
@@ -0,0 +1,11 @@
description: "Vault PKI certificate issuance and SSH host key signing tool for Puppet-managed infrastructure"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
branch_protection:
- rule_name: "master"
enable_push: false
merge_whitelist_users:
- "benvin"
approval_whitelist_users:
- "benvin"
@@ -0,0 +1,13 @@
description: "Base container image for forgebot agents"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/build"
approval_whitelist_teams:
- "docker"
- "forgebot"
@@ -0,0 +1,13 @@
description: "Dev toolchain container for forgebot agents"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/build"
approval_whitelist_teams:
- "docker"
- "forgebot"
@@ -0,0 +1,13 @@
description: "Infrastructure toolchain container for forgebot agents"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/build"
approval_whitelist_teams:
- "docker"
- "forgebot"
@@ -0,0 +1,3 @@
description: "Docker image to be used in Kubernetes as a developers container"
private: false
default_delete_branch_after_merge: true
@@ -0,0 +1,5 @@
description: "Create base almalinux docker images"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
archived: true
@@ -0,0 +1,5 @@
description: "Create almalinux docker images for buildagents"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
archived: true
@@ -0,0 +1,5 @@
description: "Jupyter single-user instance"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
archived: true
@@ -0,0 +1,5 @@
description: "Gitea Runner for Docker in Docker"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
archived: true
@@ -0,0 +1,5 @@
description: "Docker template repository"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
repo_template: true
@@ -0,0 +1,14 @@
description: "Postgres-backed External Node Classifier (ENC) for Puppet, replacing Cobbler. Go API + encapi-cli."
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/test"
- "ci/woodpecker/pr/build"
approval_whitelist_users:
- "benvin"
@@ -0,0 +1,14 @@
description: "Skill definitions for forgebot agents"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/validate"
approval_whitelist_teams:
- "forgebot"
merge_whitelist_teams:
- "forgebot"
@@ -0,0 +1,16 @@
description: "K8s operator + API for AI agent dispatch from git forges"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/test"
- "ci/woodpecker/pr/build"
approval_whitelist_teams:
- "forgebot"
merge_whitelist_teams:
- "forgebot"
@@ -0,0 +1,3 @@
description: "A repository for building initrd.img in docker "
private: false
default_delete_branch_after_merge: true
@@ -0,0 +1,12 @@
description: "Container build for the jellyfin-ha (HA transcoding) Jellyfin fork"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/build"
approval_whitelist_teams:
- "docker"
@@ -0,0 +1,14 @@
description: "A CLI tool written in Go that queries the PuppetDB API to look up and filter node facts."
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/build"
- "ci/woodpecker/pr/test"
- "ci/woodpecker/pr/pre-commit"
approval_whitelist_users:
- "benvin"
@@ -0,0 +1,15 @@
description: "Packer images for docker, incus and other systems."
private: false
default_branch: "master"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "master"
enable_push: false
merge_whitelist_teams:
- "docker"
status_check_contexts:
- "Build / build (pull_request)"
approval_whitelist_teams:
- "docker"
block_on_rejected_reviews: true
@@ -0,0 +1,37 @@
description: "production puppet-control repository"
private: false
default_branch: "develop"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "develop"
enable_push: false
merge_whitelist_teams:
- "puppet"
status_check_contexts:
- "ci/woodpecker/pr/bolt-validate"
- "ci/woodpecker/pr/epp-validate"
- "ci/woodpecker/pr/erb-validate"
- "ci/woodpecker/pr/puppet-lint"
- "ci/woodpecker/pr/puppet-validate"
- "ci/woodpecker/pr/ruby-check"
- "ci/woodpecker/pr/ruby-validate"
- "ci/woodpecker/pr/yamllint"
approval_whitelist_teams:
- "puppet"
block_on_rejected_reviews: true
- rule_name: "master"
enable_push: false
merge_whitelist_teams:
- "puppet"
status_check_contexts:
- "ci/woodpecker/pr/bolt-validate"
- "ci/woodpecker/pr/epp-validate"
- "ci/woodpecker/pr/erb-validate"
- "ci/woodpecker/pr/puppet-lint"
- "ci/woodpecker/pr/puppet-validate"
- "ci/woodpecker/pr/ruby-check"
- "ci/woodpecker/pr/ruby-validate"
- "ci/woodpecker/pr/yamllint"
approval_whitelist_teams:
- "puppet"
@@ -0,0 +1,15 @@
description: "Stores the puppet r10k yaml file"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
branch_protection:
- rule_name: "master"
enable_push: false
merge_whitelist_teams:
- "puppet"
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/g10k-validate"
approval_whitelist_teams:
- "puppet"
block_on_rejected_reviews: true
@@ -0,0 +1,4 @@
description: "A fastapi service to present puppet services via an api"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
@@ -0,0 +1,5 @@
description: "rpmbuild repo for gonic"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
archived: true
@@ -0,0 +1,4 @@
description: "Package the internal ca-certificates"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
@@ -0,0 +1,5 @@
description: "Build rpms for jellyfin-web"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
archived: true
@@ -0,0 +1,5 @@
description: "build the proxlb package"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
archived: true
@@ -0,0 +1,6 @@
description: "Template rpmbuld repo"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
archived: true
repo_template: true
@@ -0,0 +1,20 @@
description: "A repository for building RPMs in docker"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "master"
enable_push: false
merge_whitelist_teams:
- "rpmbuild"
status_check_contexts:
- "ci/woodpecker/pr/build-almalinux9"
- "ci/woodpecker/pr/build-almalinux8"
- "ci/woodpecker/pr/build-fedora42"
- "ci/woodpecker/pr/build-fedora43"
- "ci/woodpecker/pr/build-fedora44"
- "ci/woodpecker/pr/pre-commit"
approval_whitelist_teams:
- "rpmbuild"
block_on_rejected_reviews: true
@@ -0,0 +1,3 @@
description: "A stack of microservices that aim to offer a distributed streaming service."
private: false
default_delete_branch_after_merge: true
@@ -0,0 +1,18 @@
description: "Terraform configuration for managing ArtifactAPI remote and virtual repositories"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
merge_whitelist_users:
- "benvin"
- "unkinben"
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/plan"
approval_whitelist_users:
- "benvin"
approval_whitelist_teams:
- "Owners"
@@ -0,0 +1,18 @@
description: "Terraform configuration for managing Authentik identity provider"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
merge_whitelist_users:
- "benvin"
- "unkinben"
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/plan"
approval_whitelist_users:
- "benvin"
approval_whitelist_teams:
- "Owners"
@@ -0,0 +1,14 @@
description: "Manage Gitea resources, teams, repos, and Woodpecker CI via Terraform"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/plan"
approval_whitelist_users:
- "benvin"
approval_whitelist_teams:
- "Owners"
@@ -0,0 +1,15 @@
description: "Repository containing the terragrunt/terraform IaC to deploy Incus instances"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
branch_protection:
- rule_name: "master"
enable_push: false
merge_whitelist_teams:
- "terraform"
status_check_contexts:
- "Build / build (pull_request)"
approval_whitelist_teams:
- "terraform"
block_on_rejected_reviews: true
dismiss_stale_approvals: true
@@ -0,0 +1,14 @@
description: "Manage nomad with Terraform"
private: false
default_branch: "master"
default_delete_branch_after_merge: true
branch_protection:
- rule_name: "master"
enable_push: false
merge_whitelist_teams:
- "terraform"
status_check_contexts:
- "Build / build (pull_request)"
approval_whitelist_teams:
- "terraform"
dismiss_stale_approvals: true
@@ -0,0 +1,12 @@
description: "Terraform provider for managing ArtifactAPI"
private: false
default_delete_branch_after_merge: true
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/build"
- "ci/woodpecker/pr/test"
approval_whitelist_teams:
- "Owners"
@@ -0,0 +1,14 @@
description: "Terraform provider for encapi: manage Puppet ENC roles, statuses, and node assignments."
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/build"
- "ci/woodpecker/pr/test"
approval_whitelist_users:
- "benvin"
@@ -0,0 +1,19 @@
description: "Terraform provider for the Vault/OpenBao LiteLLM dynamic secrets engine (litellmvaultsecret)"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
# Squash-only: the gitea provider has no "default merge style", so we restrict
# the allowed styles to squash to force it.
allow_merge_commits: false
allow_rebase: false
allow_rebase_explicit: false
allow_squash_merge: true
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/build"
- "ci/woodpecker/pr/test"
approval_whitelist_teams:
- "Owners"
@@ -0,0 +1,18 @@
description: "Terraform configuration for managing Prowlarr indexer automation"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
merge_whitelist_users:
- "benvin"
- "unkinben"
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/plan"
approval_whitelist_users:
- "benvin"
approval_whitelist_teams:
- "Owners"
@@ -0,0 +1,18 @@
description: "Terraform configuration for managing Radarr movie automation"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
merge_whitelist_users:
- "benvin"
- "unkinben"
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/plan"
approval_whitelist_users:
- "benvin"
approval_whitelist_teams:
- "Owners"
@@ -0,0 +1,18 @@
description: "Terraform configuration for managing Sonarr TV automation"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
merge_whitelist_users:
- "benvin"
- "unkinben"
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/plan"
approval_whitelist_users:
- "benvin"
approval_whitelist_teams:
- "Owners"
@@ -0,0 +1,18 @@
description: "A repository to manage the configuration of Vault secret engines, authentication modes and policies."
private: false
default_branch: "master"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "master"
enable_push: false
merge_whitelist_users:
- "benvin"
- "unkinben"
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/plan"
approval_whitelist_users:
- "benvin"
approval_whitelist_teams:
- "Owners"
@@ -0,0 +1,8 @@
description: "Spiritual successor to shorewall — nftables firewall manager using google/nftables"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
default_merge_style: "squash"
branch_protection:
- rule_name: "main"
enable_push: false
@@ -0,0 +1,19 @@
description: "HashiCorp Vault / OpenBao dynamic secrets engine for LiteLLM virtual keys"
private: false
default_branch: "main"
default_delete_branch_after_merge: true
# Squash-only: the gitea provider has no "default merge style", so we restrict
# the allowed styles to squash to force it.
allow_merge_commits: false
allow_rebase: false
allow_rebase_explicit: false
allow_squash_merge: true
branch_protection:
- rule_name: "main"
enable_push: false
status_check_contexts:
- "ci/woodpecker/pr/pre-commit"
- "ci/woodpecker/pr/build"
- "ci/woodpecker/pr/test"
approval_whitelist_teams:
- "Owners"
@@ -0,0 +1,7 @@
description: ""
permission: owner
include_all_repositories: true
can_create_repos: true
members:
- unkinben
- benvin
@@ -0,0 +1,15 @@
description: "manage docker related repositories"
permission: none
include_all_repositories: false
can_create_repos: false
repositories:
- docker-almalinux-base
- docker-almalinux-buildrunner
- docker-almalinux-jupyterinstance
- docker-almalinux-runnerdnd
- docker-template
- packer-images
members:
- droneci
- unkinben
- benvin
@@ -0,0 +1,13 @@
description: "forgebot maintainers"
permission: none
include_all_repositories: false
can_create_repos: false
repositories:
- forgebot
- forgebot-skills
- container-agent-base
- container-agent-dev
- container-agent-infra
members:
- unkinben
- benvin
@@ -0,0 +1,10 @@
description: "owners of the puppet system"
permission: none
include_all_repositories: false
can_create_repos: false
repositories:
- puppet-prod
- puppet-r10k
members:
- unkinben
- benvin
@@ -0,0 +1,9 @@
description: "Python package builers"
permission: none
include_all_repositories: false
can_create_repos: false
repositories:
- puppetapi
members:
- unkinben
- benvin
@@ -0,0 +1,15 @@
description: "manage rpmbuild repos"
permission: none
include_all_repositories: false
can_create_repos: false
repositories:
- rpmbuilder
- rpmbuild-gonic
- rpmbuild-internal-ca-certificates
- rpmbuild-jellyfin-web
- rpmbuild-proxlb
- rpmbuild-template
members:
- droneci
- unkinben
- benvin
@@ -0,0 +1,10 @@
description: "terraform job maintainers"
permission: none
include_all_repositories: false
can_create_repos: false
repositories:
- terraform-incus
- terraform-nomad
members:
- unkinben
- benvin
+24
View File
@@ -0,0 +1,24 @@
include "root" {
path = find_in_parent_folders("root.hcl")
expose = true
}
include "config" {
path = "${get_repo_root()}/config/config.hcl"
expose = true
}
locals {
config = include.config.locals.config
}
terraform {
source = "../../../modules/gitea_instance"
}
inputs = {
organisation = local.config.organisation
repository = local.config.repository
branch_protection = local.config.branch_protection
team = local.config.team
}
+24
View File
@@ -0,0 +1,24 @@
generate "backend" {
path = "backend.tf"
if_exists = "overwrite"
contents = <<EOF
provider "gitea" {
base_url = "https://git.unkin.net"
cacert_file = "/etc/pki/tls/certs/ca-bundle.crt"
}
provider "woodpecker" {
server = "https://ci.k8s.syd1.au.unkin.net"
}
terraform {
backend "consul" {
address = "https://consul.service.consul"
path = "infra/terraform/git/${path_relative_to_include()}/state"
scheme = "https"
lock = true
ca_file = "/etc/pki/tls/certs/ca-bundle.crt"
}
}
EOF
}
+205
View File
@@ -0,0 +1,205 @@
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"
}
+96
View File
@@ -0,0 +1,96 @@
module "organisation" {
source = "./modules/organisation"
for_each = var.organisation
name = each.value.name
description = each.value.description
full_name = each.value.full_name
visibility = each.value.visibility
website = each.value.website
location = each.value.location
repo_admin_change_team_access = each.value.repo_admin_change_team_access
}
module "repository" {
source = "./modules/repository"
for_each = var.repository
name = each.value.name
organisation = each.value.organisation
description = each.value.description
private = each.value.private
default_branch = each.value.default_branch
has_issues = each.value.has_issues
has_wiki = each.value.has_wiki
has_pull_requests = each.value.has_pull_requests
has_projects = each.value.has_projects
allow_merge_commits = each.value.allow_merge_commits
allow_rebase = each.value.allow_rebase
allow_rebase_explicit = each.value.allow_rebase_explicit
allow_squash_merge = each.value.allow_squash_merge
archived = each.value.archived
repo_template = each.value.repo_template
website = each.value.website
autodetect_manual_merge = each.value.autodetect_manual_merge
depends_on = [module.organisation]
}
module "team" {
source = "./modules/team"
for_each = var.team
name = each.value.name
organisation = each.value.organisation
description = each.value.description
permission = each.value.permission
include_all_repositories = each.value.include_all_repositories
can_create_repos = each.value.can_create_repos
repositories = each.value.repositories
members = each.value.members
depends_on = [module.organisation, module.repository]
}
removed {
from = module.woodpecker_repository
lifecycle {
destroy = false
}
}
module "branch_protection" {
source = "./modules/branch_protection"
for_each = var.branch_protection
repository = each.value.repository
organisation = each.value.organisation
rule_name = each.value.rule_name
enable_push = each.value.enable_push
push_whitelist_users = each.value.push_whitelist_users
push_whitelist_teams = each.value.push_whitelist_teams
push_whitelist_deploy_keys = each.value.push_whitelist_deploy_keys
merge_whitelist_users = each.value.merge_whitelist_users
merge_whitelist_teams = each.value.merge_whitelist_teams
required_approvals = each.value.required_approvals
approval_whitelist_users = each.value.approval_whitelist_users
approval_whitelist_teams = each.value.approval_whitelist_teams
status_check_contexts = each.value.status_check_contexts
block_on_rejected_reviews = each.value.block_on_rejected_reviews
block_on_official_review_requests = each.value.block_on_official_review_requests
block_on_outdated_branch = each.value.block_on_outdated_branch
dismiss_stale_approvals = each.value.dismiss_stale_approvals
require_signed_commits = each.value.require_signed_commits
protected_file_patterns = each.value.protected_file_patterns
unprotected_file_patterns = each.value.unprotected_file_patterns
depends_on = [module.repository, module.team]
}
# TODO: enable when deploy keys are needed
# module "deploy_key" { ... }
@@ -0,0 +1,27 @@
resource "gitea_repository_branch_protection" "this" {
username = var.organisation
name = var.repository
rule_name = var.rule_name
enable_push = var.enable_push
push_whitelist_users = var.push_whitelist_users
push_whitelist_teams = var.push_whitelist_teams
push_whitelist_deploy_keys = var.push_whitelist_deploy_keys
merge_whitelist_users = var.merge_whitelist_users
merge_whitelist_teams = var.merge_whitelist_teams
required_approvals = var.required_approvals
approval_whitelist_users = var.approval_whitelist_users
approval_whitelist_teams = var.approval_whitelist_teams
status_check_patterns = var.status_check_contexts
block_merge_on_rejected_reviews = var.block_on_rejected_reviews
block_merge_on_official_review_requests = var.block_on_official_review_requests
block_merge_on_outdated_branch = var.block_on_outdated_branch
dismiss_stale_approvals = var.dismiss_stale_approvals
require_signed_commits = var.require_signed_commits
protected_file_patterns = var.protected_file_patterns
unprotected_file_patterns = var.unprotected_file_patterns
}
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.10"
required_providers {
gitea = {
source = "go-gitea/gitea"
version = "0.7.0"
}
}
}
@@ -0,0 +1,96 @@
variable "repository" {
type = string
}
variable "organisation" {
type = string
}
variable "rule_name" {
type = string
}
variable "enable_push" {
type = bool
default = false
}
variable "push_whitelist_users" {
type = list(string)
default = []
}
variable "push_whitelist_teams" {
type = list(string)
default = []
}
variable "push_whitelist_deploy_keys" {
type = bool
default = false
}
variable "merge_whitelist_users" {
type = list(string)
default = []
}
variable "merge_whitelist_teams" {
type = list(string)
default = []
}
variable "required_approvals" {
type = number
default = 0
}
variable "approval_whitelist_users" {
type = list(string)
default = []
}
variable "approval_whitelist_teams" {
type = list(string)
default = []
}
variable "status_check_contexts" {
type = list(string)
default = []
}
variable "block_on_rejected_reviews" {
type = bool
default = false
}
variable "block_on_official_review_requests" {
type = bool
default = false
}
variable "block_on_outdated_branch" {
type = bool
default = false
}
variable "dismiss_stale_approvals" {
type = bool
default = false
}
variable "require_signed_commits" {
type = bool
default = false
}
variable "protected_file_patterns" {
type = string
default = ""
}
variable "unprotected_file_patterns" {
type = string
default = ""
}
@@ -0,0 +1,6 @@
resource "gitea_repository_key" "this" {
repository = var.repository_id
title = var.title
key = var.key
read_only = var.read_only
}
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.10"
required_providers {
gitea = {
source = "go-gitea/gitea"
version = "0.7.0"
}
}
}
@@ -0,0 +1,16 @@
variable "repository_id" {
type = number
}
variable "title" {
type = string
}
variable "key" {
type = string
}
variable "read_only" {
type = bool
default = true
}
@@ -0,0 +1,9 @@
resource "gitea_org" "this" {
name = var.name
description = var.description
full_name = var.full_name
visibility = var.visibility
website = var.website
location = var.location
repo_admin_change_team_access = var.repo_admin_change_team_access
}
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.10"
required_providers {
gitea = {
source = "go-gitea/gitea"
version = "0.7.0"
}
}
}
@@ -0,0 +1,33 @@
variable "name" {
type = string
}
variable "description" {
type = string
default = ""
}
variable "full_name" {
type = string
default = null
}
variable "visibility" {
type = string
default = "public"
}
variable "website" {
type = string
default = ""
}
variable "location" {
type = string
default = ""
}
variable "repo_admin_change_team_access" {
type = bool
default = false
}
@@ -0,0 +1,20 @@
resource "gitea_repository" "this" {
username = var.organisation
name = var.name
description = var.description
private = var.private
default_branch = var.default_branch
has_issues = var.has_issues
has_wiki = var.has_wiki
has_pull_requests = var.has_pull_requests
has_projects = var.has_projects
allow_merge_commits = var.allow_merge_commits
allow_rebase = var.allow_rebase
allow_rebase_explicit = var.allow_rebase_explicit
allow_squash_merge = var.allow_squash_merge
archived = var.archived
repo_template = var.repo_template
website = var.website
autodetect_manual_merge = var.autodetect_manual_merge
archive_on_destroy = true
}
@@ -0,0 +1,3 @@
output "id" {
value = gitea_repository.this.id
}
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.10"
required_providers {
gitea = {
source = "go-gitea/gitea"
version = "0.7.0"
}
}
}
@@ -0,0 +1,82 @@
variable "name" {
type = string
}
variable "organisation" {
type = string
}
variable "description" {
type = string
default = null
}
variable "private" {
type = bool
default = null
}
variable "default_branch" {
type = string
default = null
}
variable "has_issues" {
type = bool
default = true
}
variable "has_wiki" {
type = bool
default = false
}
variable "has_pull_requests" {
type = bool
default = true
}
variable "has_projects" {
type = bool
default = false
}
variable "allow_merge_commits" {
type = bool
default = false
}
variable "allow_rebase" {
type = bool
default = false
}
variable "allow_rebase_explicit" {
type = bool
default = false
}
variable "allow_squash_merge" {
type = bool
default = true
}
variable "archived" {
type = bool
default = null
}
variable "repo_template" {
type = bool
default = null
}
variable "website" {
type = string
default = null
}
variable "autodetect_manual_merge" {
type = bool
default = null
}
@@ -0,0 +1,18 @@
resource "gitea_team" "this" {
name = var.name
organisation = var.organisation
description = var.description
permission = var.permission
include_all_repositories = var.include_all_repositories
can_create_repos = var.can_create_repos
repositories = var.repositories
lifecycle {
ignore_changes = [permission]
}
}
resource "gitea_team_members" "this" {
team_id = gitea_team.this.id
members = toset(var.members)
}
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.10"
required_providers {
gitea = {
source = "go-gitea/gitea"
version = "0.7.0"
}
}
}
@@ -0,0 +1,37 @@
variable "name" {
type = string
}
variable "organisation" {
type = string
}
variable "description" {
type = string
default = ""
}
variable "permission" {
type = string
default = "read"
}
variable "include_all_repositories" {
type = bool
default = false
}
variable "can_create_repos" {
type = bool
default = false
}
variable "repositories" {
type = list(string)
default = []
}
variable "members" {
type = list(string)
default = []
}
+13
View File
@@ -0,0 +1,13 @@
terraform {
required_version = ">= 1.10"
required_providers {
gitea = {
source = "go-gitea/gitea"
version = "0.7.0"
}
woodpecker = {
source = "Kichiyaki/woodpecker"
version = "0.5.0"
}
}
}
+80
View File
@@ -0,0 +1,80 @@
variable "organisation" {
description = "Map of organisations to create"
type = map(object({
name = string
description = optional(string, "")
full_name = optional(string)
visibility = optional(string, "public")
website = optional(string, "")
location = optional(string, "")
repo_admin_change_team_access = optional(bool, false)
}))
default = {}
}
variable "repository" {
description = "Map of repositories to create"
type = map(object({
name = string
organisation = string
description = optional(string)
private = optional(bool)
default_branch = optional(string)
has_issues = optional(bool)
has_wiki = optional(bool)
has_pull_requests = optional(bool)
has_projects = optional(bool)
allow_merge_commits = optional(bool)
allow_rebase = optional(bool)
allow_rebase_explicit = optional(bool)
allow_squash_merge = optional(bool)
archived = optional(bool)
repo_template = optional(bool)
website = optional(string)
autodetect_manual_merge = optional(bool)
}))
default = {}
}
variable "branch_protection" {
description = "Map of branch protection rules to create"
type = map(object({
repository = string
organisation = string
rule_name = string
enable_push = optional(bool, false)
push_whitelist_users = optional(list(string), [])
push_whitelist_teams = optional(list(string), [])
push_whitelist_deploy_keys = optional(bool, false)
merge_whitelist_users = optional(list(string), [])
merge_whitelist_teams = optional(list(string), [])
required_approvals = optional(number, 0)
approval_whitelist_users = optional(list(string), [])
approval_whitelist_teams = optional(list(string), [])
status_check_contexts = optional(list(string), [])
block_on_rejected_reviews = optional(bool, false)
block_on_official_review_requests = optional(bool, false)
block_on_outdated_branch = optional(bool, false)
dismiss_stale_approvals = optional(bool, false)
require_signed_commits = optional(bool, false)
protected_file_patterns = optional(string, "")
unprotected_file_patterns = optional(string, "")
}))
default = {}
}
variable "team" {
description = "Map of teams to create"
type = map(object({
name = string
organisation = string
description = optional(string, "")
permission = optional(string, "read")
include_all_repositories = optional(bool, false)
can_create_repos = optional(bool, false)
repositories = optional(list(string), [])
members = optional(list(string), [])
}))
default = {}
}