Skip to content

Commit 9cd3cd4

Browse files
committed
Changing repos to a local value for main.tf
1 parent c617620 commit 9cd3cd4

File tree

6 files changed

+18
-25
lines changed

6 files changed

+18
-25
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ No modules.
3131
| Name | Description | Type | Default | Required |
3232
|------|-------------|------|---------|:--------:|
3333
| <a name="input_github_owner"></a> [github\_owner](#input\_github\_owner) | The GitHub owner (user or organization) for the repository. | `string` | `"makeitworkcloud"` | no |
34-
| <a name="input_github_repositories"></a> [github\_repositories](#input\_github\_repositories) | Set of GitHub repositories to manage | `set(string)` | `[]` | no |
3534
| <a name="input_github_visibility"></a> [github\_visibility](#input\_github\_visibility) | Public, private, or internal visibility | `string` | `"public"` | no |
3635

3736
## Outputs

gh-protections.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
22
import {
3-
for_each = var.github_repositories
3+
for_each = local.github_repositories
44
to = github_branch_protection.protections[each.key]
55
id = "${each.key}:main"
66
}
77
*/
88

99
resource "github_branch_protection" "protections" {
10-
for_each = var.github_repositories
10+
for_each = local.github_repositories
1111
repository_id = github_repository.repositories[each.key].node_id
1212
pattern = "main"
1313
enforce_admins = true

gh-repositories.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
22
import {
3-
for_each = var.github_repositories
3+
for_each = local.github_repositories
44
to = github_repository.repositories[each.key]
55
id = each.key
66
}
77
*/
88

99
resource "github_repository" "repositories" {
10-
for_each = var.github_repositories
10+
for_each = local.github_repositories
1111
name = each.key
1212
visibility = var.github_visibility
1313
lifecycle {

main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ data "sops_file" "secret_vars" {
33
}
44

55
locals {
6+
github_repositories = toset([
7+
".github",
8+
"aap-libvirt-infra",
9+
"ansible-site-cluster",
10+
"ansible-role-crc",
11+
"ansible-role-ksops",
12+
"gitops-cluster",
13+
"cflan",
14+
"onion",
15+
"terraform-github-repos",
16+
"terraform-libvirt-infra",
17+
"terraform-runner",
18+
"www"
19+
])
620
secrets = {
721
"onion_s3_bucket" = {
822
name = "AWS_S3_BUCKET"

terraform.tfvars

Lines changed: 0 additions & 14 deletions
This file was deleted.

variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ variable "github_owner" {
44
default = "makeitworkcloud"
55
}
66

7-
variable "github_repositories" {
8-
description = "Set of GitHub repositories to manage"
9-
type = set(string)
10-
default = []
11-
}
12-
137
variable "github_visibility" {
148
description = "Public, private, or internal visibility"
159
type = string

0 commit comments

Comments
 (0)