diff --git a/common/variables.tf b/common/variables.tf index cbb8381b..8edaf942 100644 --- a/common/variables.tf +++ b/common/variables.tf @@ -89,7 +89,7 @@ variable "hieradata" { default = "---" description = "String formatted as YAML defining hiera key-value pairs to be included in the puppet environment" validation { - condition = can(yamldecode(var.hieradata)) + condition = var.hieradata == "" || can(yamldecode(var.hieradata)) error_message = "Hieradata needs to be valid YAML" } }