Skip to content

Commit

Permalink
Merge pull request #284 from etiennedub/yaml_validation
Browse files Browse the repository at this point in the history
Yaml validation on hierada
  • Loading branch information
cmd-ntrf authored Jan 26, 2024
2 parents 7f999c7 + 401a948 commit cf59cf3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion common/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ variable "hieradata" {
type = string
default = "---"
description = "String formatted as YAML defining hiera key-value pairs to be included in the puppet environment"
validation {
condition = can(yamldecode(var.hieradata))
error_message = "Hieradata needs to be valid YAML"
}
}

variable "sudoer_username" {
Expand Down Expand Up @@ -149,4 +153,4 @@ variable "puppetfile" {
type = string
default = ""
description = "Additional content for the pupet environment Puppetfile. If the string includes a `forge` setting, the string replaces the original Puppetfile completely."
}
}

0 comments on commit cf59cf3

Please sign in to comment.