Compare commits
11 Commits
afb2105aab
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 36d7afbb65 | |||
| c33dcdc447 | |||
| be9bd96cf3 | |||
| bb5f6922fa | |||
| 346cf9fa43 | |||
| 1288057b81 | |||
| 3876fa818d | |||
| a548bf1cb1 | |||
| 93ba86baf3 | |||
| 098830c10b | |||
| 9cbac6d3ef |
@@ -0,0 +1,23 @@
|
|||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: master
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: apply
|
||||||
|
image: git.unkin.net/unkin/almalinux9-opentofu:20260606
|
||||||
|
environment:
|
||||||
|
VAULT_AUTH_METHOD: kubernetes
|
||||||
|
commands:
|
||||||
|
- dnf install vault -y
|
||||||
|
- make plan
|
||||||
|
- make apply
|
||||||
|
backend_options:
|
||||||
|
kubernetes:
|
||||||
|
serviceAccountName: terraform-vault
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: 512Mi
|
||||||
|
cpu: 1
|
||||||
|
limits:
|
||||||
|
memory: 2Gi
|
||||||
|
cpu: 2
|
||||||
@@ -3,10 +3,11 @@ when:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: plan
|
- name: plan
|
||||||
image: git.unkin.net/unkin/almalinux9-opentofu:20260308
|
image: git.unkin.net/unkin/almalinux9-opentofu:20260606
|
||||||
environment:
|
environment:
|
||||||
VAULT_AUTH_METHOD: kubernetes
|
VAULT_AUTH_METHOD: kubernetes
|
||||||
commands:
|
commands:
|
||||||
|
- dnf install vault -y
|
||||||
- make plan
|
- make plan
|
||||||
backend_options:
|
backend_options:
|
||||||
kubernetes:
|
kubernetes:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ when:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: pre-commit
|
- name: pre-commit
|
||||||
image: git.unkin.net/unkin/almalinux9-opentofu:20260308
|
image: git.unkin.net/unkin/almalinux9-opentofu:20260606
|
||||||
commands:
|
commands:
|
||||||
- uvx pre-commit run --all-files
|
- uvx pre-commit run --all-files
|
||||||
backend_options:
|
backend_options:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ define vault_env
|
|||||||
else \
|
else \
|
||||||
export VAULT_TOKEN=$$(vault write -field=token auth/approle/login role_id=$$VAULT_ROLEID); \
|
export VAULT_TOKEN=$$(vault write -field=token auth/approle/login role_id=$$VAULT_ROLEID); \
|
||||||
fi && \
|
fi && \
|
||||||
export CONSUL_HTTP_TOKEN=$$(vault read -format=json consul_root/au/syd1/creds/terraform-vault | jq '.data.token')
|
export CONSUL_HTTP_TOKEN=$$(vault read -field=token consul_root/au/syd1/creds/terraform-vault)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
init:
|
init:
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
token_ttl: 120
|
||||||
|
token_max_ttl: 120
|
||||||
|
bind_secret_id: false
|
||||||
|
token_bound_cidrs:
|
||||||
|
- "10.10.12.200/32"
|
||||||
|
- "198.18.25.102/32"
|
||||||
|
- "198.18.26.91/32"
|
||||||
|
- "198.18.27.40/32"
|
||||||
|
use_deterministic_role_id: true
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
token_ttl: 120
|
||||||
|
token_max_ttl: 120
|
||||||
|
bind_secret_id: false
|
||||||
|
token_bound_cidrs:
|
||||||
|
- "10.10.12.200/32"
|
||||||
|
- "198.18.25.102/32"
|
||||||
|
- "198.18.26.91/32"
|
||||||
|
- "198.18.27.40/32"
|
||||||
|
use_deterministic_role_id: true
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
token_ttl: 120
|
||||||
|
token_max_ttl: 120
|
||||||
|
bind_secret_id: false
|
||||||
|
token_bound_cidrs:
|
||||||
|
- "10.10.12.200/32"
|
||||||
|
- "198.18.25.102/32"
|
||||||
|
- "198.18.26.91/32"
|
||||||
|
- "198.18.27.40/32"
|
||||||
|
use_deterministic_role_id: true
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
token_ttl: 120
|
||||||
|
token_max_ttl: 120
|
||||||
|
bind_secret_id: false
|
||||||
|
token_bound_cidrs:
|
||||||
|
- "10.10.12.200/32"
|
||||||
|
- "198.18.25.102/32"
|
||||||
|
- "198.18.26.91/32"
|
||||||
|
- "198.18.27.40/32"
|
||||||
|
use_deterministic_role_id: true
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
token_ttl: 120
|
||||||
|
token_max_ttl: 120
|
||||||
|
bind_secret_id: false
|
||||||
|
token_bound_cidrs:
|
||||||
|
- "10.10.12.200/32"
|
||||||
|
- "198.18.25.102/32"
|
||||||
|
- "198.18.26.91/32"
|
||||||
|
- "198.18.27.40/32"
|
||||||
|
use_deterministic_role_id: true
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
token_ttl: 120
|
||||||
|
token_max_ttl: 120
|
||||||
|
bind_secret_id: false
|
||||||
|
token_bound_cidrs:
|
||||||
|
- "10.10.12.200/32"
|
||||||
|
- "198.18.25.102/32"
|
||||||
|
- "198.18.26.91/32"
|
||||||
|
- "198.18.27.40/32"
|
||||||
|
use_deterministic_role_id: true
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
bound_service_account_names:
|
||||||
|
- terraform-artifactapi
|
||||||
|
bound_service_account_namespaces:
|
||||||
|
- woodpecker
|
||||||
|
token_ttl: 600
|
||||||
|
token_max_ttl: 600
|
||||||
|
audience: https://kubernetes.default.svc.cluster.local
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
bound_service_account_names:
|
||||||
|
- terraform-authentik
|
||||||
|
bound_service_account_namespaces:
|
||||||
|
- woodpecker
|
||||||
|
token_ttl: 600
|
||||||
|
token_max_ttl: 600
|
||||||
|
audience: https://kubernetes.default.svc.cluster.local
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
bound_service_account_names:
|
||||||
|
- terraform-git
|
||||||
|
bound_service_account_namespaces:
|
||||||
|
- woodpecker
|
||||||
|
token_ttl: 600
|
||||||
|
token_max_ttl: 600
|
||||||
|
audience: https://kubernetes.default.svc.cluster.local
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
bound_service_account_names:
|
||||||
|
- terraform-prowlarr
|
||||||
|
bound_service_account_namespaces:
|
||||||
|
- woodpecker
|
||||||
|
token_ttl: 600
|
||||||
|
token_max_ttl: 600
|
||||||
|
audience: https://kubernetes.default.svc.cluster.local
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
bound_service_account_names:
|
||||||
|
- terraform-radarr
|
||||||
|
bound_service_account_namespaces:
|
||||||
|
- woodpecker
|
||||||
|
token_ttl: 600
|
||||||
|
token_max_ttl: 600
|
||||||
|
audience: https://kubernetes.default.svc.cluster.local
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
bound_service_account_names:
|
||||||
|
- terraform-sonarr
|
||||||
|
bound_service_account_namespaces:
|
||||||
|
- woodpecker
|
||||||
|
token_ttl: 600
|
||||||
|
token_max_ttl: 600
|
||||||
|
audience: https://kubernetes.default.svc.cluster.local
|
||||||
@@ -4,4 +4,4 @@ bound_service_account_namespaces:
|
|||||||
- woodpecker
|
- woodpecker
|
||||||
token_ttl: 600
|
token_ttl: 600
|
||||||
token_max_ttl: 600
|
token_max_ttl: 600
|
||||||
audience: vault
|
audience: https://kubernetes.default.svc.cluster.local
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
consul_roles:
|
||||||
|
- terraform-artifactapi
|
||||||
|
ttl: 120
|
||||||
|
max_ttl: 300
|
||||||
|
datacenters: []
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
consul_roles:
|
||||||
|
- terraform-authentik
|
||||||
|
ttl: 120
|
||||||
|
max_ttl: 300
|
||||||
|
datacenters: []
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
consul_roles:
|
||||||
|
- terraform-git
|
||||||
|
ttl: 120
|
||||||
|
max_ttl: 300
|
||||||
|
datacenters: []
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
consul_roles:
|
||||||
|
- terraform-prowlarr
|
||||||
|
ttl: 120
|
||||||
|
max_ttl: 300
|
||||||
|
datacenters: []
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
consul_roles:
|
||||||
|
- terraform-radarr
|
||||||
|
ttl: 120
|
||||||
|
max_ttl: 300
|
||||||
|
datacenters: []
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
consul_roles:
|
||||||
|
- terraform-sonarr
|
||||||
|
ttl: 120
|
||||||
|
max_ttl: 300
|
||||||
|
datacenters: []
|
||||||
@@ -21,3 +21,5 @@ rules:
|
|||||||
auth:
|
auth:
|
||||||
approle:
|
approle:
|
||||||
- tf_vault
|
- tf_vault
|
||||||
|
k8s/au/syd1:
|
||||||
|
- woodpecker_terraform_vault
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
rules:
|
||||||
|
- path: "consul_root/au/syd1/creds/terraform-artifactapi"
|
||||||
|
capabilities:
|
||||||
|
- read
|
||||||
|
|
||||||
|
auth:
|
||||||
|
approle:
|
||||||
|
- terraform_artifactapi
|
||||||
|
k8s/au/syd1:
|
||||||
|
- woodpecker_terraform_artifactapi
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
rules:
|
||||||
|
- path: "consul_root/au/syd1/creds/terraform-authentik"
|
||||||
|
capabilities:
|
||||||
|
- read
|
||||||
|
|
||||||
|
auth:
|
||||||
|
approle:
|
||||||
|
- terraform_authentik
|
||||||
|
k8s/au/syd1:
|
||||||
|
- woodpecker_terraform_authentik
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
rules:
|
||||||
|
- path: "consul_root/au/syd1/creds/terraform-git"
|
||||||
|
capabilities:
|
||||||
|
- read
|
||||||
|
|
||||||
|
auth:
|
||||||
|
approle:
|
||||||
|
- terraform_git
|
||||||
|
k8s/au/syd1:
|
||||||
|
- woodpecker_terraform_git
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
rules:
|
||||||
|
- path: "consul_root/au/syd1/creds/terraform-prowlarr"
|
||||||
|
capabilities:
|
||||||
|
- read
|
||||||
|
|
||||||
|
auth:
|
||||||
|
approle:
|
||||||
|
- terraform_prowlarr
|
||||||
|
k8s/au/syd1:
|
||||||
|
- woodpecker_terraform_prowlarr
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
rules:
|
||||||
|
- path: "consul_root/au/syd1/creds/terraform-radarr"
|
||||||
|
capabilities:
|
||||||
|
- read
|
||||||
|
|
||||||
|
auth:
|
||||||
|
approle:
|
||||||
|
- terraform_radarr
|
||||||
|
k8s/au/syd1:
|
||||||
|
- woodpecker_terraform_radarr
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
rules:
|
||||||
|
- path: "consul_root/au/syd1/creds/terraform-sonarr"
|
||||||
|
capabilities:
|
||||||
|
- read
|
||||||
|
|
||||||
|
auth:
|
||||||
|
approle:
|
||||||
|
- terraform_sonarr
|
||||||
|
k8s/au/syd1:
|
||||||
|
- woodpecker_terraform_sonarr
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Allow reading Gitea admin token
|
||||||
|
---
|
||||||
|
rules:
|
||||||
|
- path: "kv/data/service/gitea/gitadmin/tokens/terraform-git"
|
||||||
|
capabilities:
|
||||||
|
- read
|
||||||
|
|
||||||
|
auth:
|
||||||
|
approle:
|
||||||
|
- terraform_git
|
||||||
|
k8s/au/syd1:
|
||||||
|
- woodpecker_terraform_git
|
||||||
@@ -6,5 +6,8 @@ rules:
|
|||||||
- read
|
- read
|
||||||
|
|
||||||
auth:
|
auth:
|
||||||
|
approle:
|
||||||
|
- terraform_prowlarr
|
||||||
k8s/au/syd1:
|
k8s/au/syd1:
|
||||||
- media-apps
|
- media-apps
|
||||||
|
- woodpecker_terraform_prowlarr
|
||||||
|
|||||||
@@ -6,5 +6,8 @@ rules:
|
|||||||
- read
|
- read
|
||||||
|
|
||||||
auth:
|
auth:
|
||||||
|
approle:
|
||||||
|
- terraform_radarr
|
||||||
k8s/au/syd1:
|
k8s/au/syd1:
|
||||||
- media-apps
|
- media-apps
|
||||||
|
- woodpecker_terraform_radarr
|
||||||
|
|||||||
@@ -6,5 +6,8 @@ rules:
|
|||||||
- read
|
- read
|
||||||
|
|
||||||
auth:
|
auth:
|
||||||
|
approle:
|
||||||
|
- terraform_sonarr
|
||||||
k8s/au/syd1:
|
k8s/au/syd1:
|
||||||
- media-apps
|
- media-apps
|
||||||
|
- woodpecker_terraform_sonarr
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
rules:
|
||||||
|
- path: "kv/data/service/woodpecker/tokens/gitadmin"
|
||||||
|
capabilities:
|
||||||
|
- read
|
||||||
|
|
||||||
|
auth:
|
||||||
|
approle:
|
||||||
|
- terraform_git
|
||||||
|
k8s/au/syd1:
|
||||||
|
- woodpecker_terraform_git
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
key_prefix "infra/terraform/artifactapi/" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
|
|
||||||
|
session_prefix "" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
key_prefix "infra/terraform/authentik/" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
|
|
||||||
|
session_prefix "" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
key_prefix "infra/terraform/git/" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
|
|
||||||
|
session_prefix "" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
key_prefix "infra/terraform/prowlarr/" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
|
|
||||||
|
session_prefix "" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
key_prefix "infra/terraform/radarr/" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
|
|
||||||
|
session_prefix "" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
key_prefix "infra/terraform/sonarr/" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
|
|
||||||
|
session_prefix "" {
|
||||||
|
policy = "write"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user