Page MenuHomeDevCentral

D4139.diff
No OneTemporary

D4139.diff

diff --git a/.editorconfig b/.editorconfig
--- a/.editorconfig
+++ b/.editorconfig
@@ -8,12 +8,12 @@
charset = utf-8
# 4 space indentation
-[*.{conf,php,py,sh,hcl,tf}]
+[*.{conf,php,py,sh,hcl}]
indent_style = space
indent_size = 4
# 2 space indentation
-[*.{sls,jinja,json,yml,yaml}]
+[*.{sls,jinja,json,yml,yaml,tf}]
indent_style = space
indent_size = 2
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -48,7 +48,10 @@
files: ^(roles|hotfixes).*\.(sls)$
- repo: https://devcentral.nasqueron.org/source/codestyle.git
- rev: v0.1.1
+ rev: v0.2.0
hooks:
- id: shellcheck
args: ["--severity=warning"]
+
+ - id: tf-format
+
diff --git a/terraform/openbao/modules/app_credentials/main.tf b/terraform/openbao/modules/app_credentials/main.tf
--- a/terraform/openbao/modules/app_credentials/main.tf
+++ b/terraform/openbao/modules/app_credentials/main.tf
@@ -12,23 +12,23 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
resource "vault_approle_auth_backend_role" "this" {
- backend = "approle"
+ backend = "approle"
- role_name = var.role_name
- secret_id_bound_cidrs = var.secret_id_bound_cidrs
- token_policies = var.policies
- token_ttl = var.token_ttl
- token_max_ttl = var.token_max_ttl
+ role_name = var.role_name
+ secret_id_bound_cidrs = var.secret_id_bound_cidrs
+ token_policies = var.policies
+ token_ttl = var.token_ttl
+ token_max_ttl = var.token_max_ttl
}
data "vault_approle_auth_backend_role_id" "this" {
- backend = "approle"
- role_name = vault_approle_auth_backend_role.this.role_name
+ backend = "approle"
+ role_name = vault_approle_auth_backend_role.this.role_name
}
resource "vault_approle_auth_backend_role_secret_id" "this" {
- backend = "approle"
- role_name = vault_approle_auth_backend_role.this.role_name
+ backend = "approle"
+ role_name = vault_approle_auth_backend_role.this.role_name
}
# -------------------------------------------------------------
@@ -36,11 +36,11 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
resource "vault_kv_secret_v2" "this" {
- mount = var.kv_mount
- name = var.kv_path
+ mount = var.kv_mount
+ name = var.kv_path
- data_json = jsonencode({
- role_id = data.vault_approle_auth_backend_role_id.this.role_id
- secret_id = vault_approle_auth_backend_role_secret_id.this.secret_id
- })
+ data_json = jsonencode({
+ role_id = data.vault_approle_auth_backend_role_id.this.role_id
+ secret_id = vault_approle_auth_backend_role_secret_id.this.secret_id
+ })
}
diff --git a/terraform/openbao/modules/app_credentials/variables.tf b/terraform/openbao/modules/app_credentials/variables.tf
--- a/terraform/openbao/modules/app_credentials/variables.tf
+++ b/terraform/openbao/modules/app_credentials/variables.tf
@@ -6,40 +6,40 @@
# -------------------------------------------------------------
variable "role_name" {
- description = "Name of the AppRole"
- type = string
+ description = "Name of the AppRole"
+ type = string
}
variable "kv_mount" {
- description = "Mount path of KV v2 engine where to save the approle credentials"
- type = string
- default = "ops"
+ description = "Mount path of KV v2 engine where to save the approle credentials"
+ type = string
+ default = "ops"
}
variable "kv_path" {
- description = "KV v2 secret path where to save the approle credentials"
- type = string
+ description = "KV v2 secret path where to save the approle credentials"
+ type = string
}
variable "policies" {
- description = "List of policies attached to this AppRole"
- type = list(string)
+ description = "List of policies attached to this AppRole"
+ type = list(string)
}
variable "secret_id_bound_cidrs" {
- description = "List of CIDR blocks of IP addresses allowed to login."
- type = list(string)
- default = []
+ description = "List of CIDR blocks of IP addresses allowed to login."
+ type = list(string)
+ default = []
}
variable "token_ttl" {
- description = "Default token TTL for the AppRole"
- type = number
- default = 300
+ description = "Default token TTL for the AppRole"
+ type = number
+ default = 300
}
variable "token_max_ttl" {
- description = "Maximum token TTL for the AppRole in seconds (0 means use system default)"
- type = number
- default = 0
+ description = "Maximum token TTL for the AppRole in seconds (0 means use system default)"
+ type = number
+ default = 0
}
diff --git a/terraform/openbao/providers.tf b/terraform/openbao/providers.tf
--- a/terraform/openbao/providers.tf
+++ b/terraform/openbao/providers.tf
@@ -6,14 +6,14 @@
# -------------------------------------------------------------
terraform {
- required_providers {
- vault = {
- source = "hashicorp/vault"
- version = "5.3.0"
- }
+ required_providers {
+ vault = {
+ source = "hashicorp/vault"
+ version = "5.3.0"
}
+ }
}
provider "vault" {
- address = "https://172.27.27.7:8200"
+ address = "https://172.27.27.7:8200"
}
diff --git a/terraform/openbao/rhyne_wyse.tf b/terraform/openbao/rhyne_wyse.tf
--- a/terraform/openbao/rhyne_wyse.tf
+++ b/terraform/openbao/rhyne_wyse.tf
@@ -12,8 +12,8 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
resource "vault_policy" "rhyne_wyse" {
- name = "rhyne-wyse"
- policy = file("${path.module}/policies/rhyne-wyse.hcl")
+ name = "rhyne-wyse"
+ policy = file("${path.module}/policies/rhyne-wyse.hcl")
}
# -------------------------------------------------------------
@@ -21,17 +21,17 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
module "rhyne_wyse_approle" {
- source = "./modules/app_credentials"
+ source = "./modules/app_credentials"
- role_name = "rhyne-wyse"
- policies = ["rhyne-wyse"]
+ role_name = "rhyne-wyse"
+ policies = ["rhyne-wyse"]
- secret_id_bound_cidrs = [
- # Windriver
- "172.27.27.35/32"
- ]
+ secret_id_bound_cidrs = [
+ # Windriver
+ "172.27.27.35/32"
+ ]
- # Save credentials to
- kv_mount = "ops"
- kv_path = "secrets/nasqueron/rhyne-wyse/vault"
+ # Save credentials to
+ kv_mount = "ops"
+ kv_path = "secrets/nasqueron/rhyne-wyse/vault"
}
diff --git a/terraform/openbao/router.tf b/terraform/openbao/router.tf
--- a/terraform/openbao/router.tf
+++ b/terraform/openbao/router.tf
@@ -12,8 +12,8 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
resource "vault_policy" "router" {
- name = "router"
- policy = file("${path.module}/policies/router.hcl")
+ name = "router"
+ policy = file("${path.module}/policies/router.hcl")
}
# -------------------------------------------------------------
@@ -21,17 +21,17 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
module "router_approle" {
- source = "./modules/app_credentials"
+ source = "./modules/app_credentials"
- role_name = "router"
- policies = ["router"]
+ role_name = "router"
+ policies = ["router"]
- secret_id_bound_cidrs = [
- "172.27.27.11/32", # router-002
- "172.27.27.12/32", # router-003
- ]
+ secret_id_bound_cidrs = [
+ "172.27.27.11/32", # router-002
+ "172.27.27.12/32", # router-003
+ ]
- # Save credentials to
- kv_mount = "ops"
- kv_path = "secrets/network/router/vault"
+ # Save credentials to
+ kv_mount = "ops"
+ kv_path = "secrets/network/router/vault"
}
diff --git a/terraform/openbao/viperserv.tf b/terraform/openbao/viperserv.tf
--- a/terraform/openbao/viperserv.tf
+++ b/terraform/openbao/viperserv.tf
@@ -12,8 +12,8 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
resource "vault_policy" "viperserv" {
- name = "viperserv"
- policy = file("${path.module}/policies/viperserv.hcl")
+ name = "viperserv"
+ policy = file("${path.module}/policies/viperserv.hcl")
}
# -------------------------------------------------------------
@@ -21,20 +21,20 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
module "viperserv_approle" {
- source = "./modules/app_credentials"
+ source = "./modules/app_credentials"
- role_name = "viperserv"
- policies = ["viperserv"]
+ role_name = "viperserv"
+ policies = ["viperserv"]
- secret_id_bound_cidrs = [
- # Windriver
- "172.27.27.35/32"
- ]
+ secret_id_bound_cidrs = [
+ # Windriver
+ "172.27.27.35/32"
+ ]
- token_ttl = 3600 # 1h
- token_max_ttl = 14400 # 4h
+ token_ttl = 3600 # 1h
+ token_max_ttl = 14400 # 4h
- # Save credentials to
- kv_mount = "ops"
- kv_path = "secrets/nasqueron/viperserv/vault"
+ # Save credentials to
+ kv_mount = "ops"
+ kv_path = "secrets/nasqueron/viperserv/vault"
}

File Metadata

Mime Type
text/plain
Expires
Wed, Aug 5, 04:13 (22 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3971932
Default Alt Text
D4139.diff (8 KB)

Event Timeline