Fix Terraform validation errors
Some checks failed
Code Quality & Security Scan / TFLint (push) Successful in 19s
Code Quality & Security Scan / Tfsec Security Scan (push) Successful in 27s
Code Quality & Security Scan / Checkov Security Scan (push) Successful in 37s
Code Quality & Security Scan / Terraform Validate (push) Failing after 32s
Code Quality & Security Scan / SonarQube Trigger (push) Has been skipped
Some checks failed
Code Quality & Security Scan / TFLint (push) Successful in 19s
Code Quality & Security Scan / Tfsec Security Scan (push) Successful in 27s
Code Quality & Security Scan / Checkov Security Scan (push) Successful in 37s
Code Quality & Security Scan / Terraform Validate (push) Failing after 32s
Code Quality & Security Scan / SonarQube Trigger (push) Has been skipped
- Fix ansible_host resource: use 'name' and 'variables' instead of 'inventory_hostname' and 'vars' - Add missing Vault authentication variables: role_id and secret_id - Update CI/CD pipeline to provide dummy auth variables for validation - Run terraform fmt
This commit is contained in:
parent
6daa3ee084
commit
8a2341423a
@ -90,6 +90,8 @@ jobs:
|
||||
TF_VAR_vault_address: "https://vault.example.com:8200"
|
||||
TF_VAR_environment: "test"
|
||||
TF_VAR_short_hostname: "test-host"
|
||||
TF_VAR_role_id: "dummy-role-id"
|
||||
TF_VAR_secret_id: "dummy-secret-id"
|
||||
run: terraform init -backend=false
|
||||
|
||||
- name: Terraform Validate
|
||||
@ -98,6 +100,8 @@ jobs:
|
||||
TF_VAR_vault_address: "https://vault.example.com:8200"
|
||||
TF_VAR_environment: "test"
|
||||
TF_VAR_short_hostname: "test-host"
|
||||
TF_VAR_role_id: "dummy-role-id"
|
||||
TF_VAR_secret_id: "dummy-secret-id"
|
||||
run: terraform validate
|
||||
|
||||
sonarqube:
|
||||
|
||||
@ -28,10 +28,10 @@ resource "vault_approle_auth_backend_role_secret_id" "cert_role_secret" {
|
||||
}
|
||||
|
||||
resource "ansible_host" "vault_agent_node" {
|
||||
inventory_hostname = var.short_hostname
|
||||
groups = ["vault_agent"]
|
||||
name = var.short_hostname
|
||||
groups = ["vault_agent"]
|
||||
|
||||
vars = {
|
||||
variables = {
|
||||
ansible_user = "ansible"
|
||||
ansible_ssh_private_key_file = "~/.ssh/id_ed25519"
|
||||
ansible_python_interpreter = "/usr/bin/python3"
|
||||
|
||||
@ -28,3 +28,15 @@ variable "vault_address" {
|
||||
}
|
||||
}
|
||||
|
||||
variable "role_id" {
|
||||
type = string
|
||||
description = "Vault AppRole role_id for authentication"
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "secret_id" {
|
||||
type = string
|
||||
description = "Vault AppRole secret_id for authentication"
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user