diff --git a/archive.tf b/archive.tf index e374bff..705a2ee 100644 --- a/archive.tf +++ b/archive.tf @@ -19,7 +19,7 @@ resource "null_resource" "archive" { } provisioner "local-exec" { - command = lookup(data.external.archive.result, "build_command") + command = var.silent ? join(" ", lookup(data.external.archive.result, "build_command"), "&>/dev/null") : lookup(data.external.archive.result, "build_command") working_dir = path.module } } @@ -33,7 +33,7 @@ data "external" "built" { program = ["python", "${path.module}/built.py"] query = { - build_command = lookup(data.external.archive.result, "build_command") + build_command = var.silent ? join(" ", lookup(data.external.archive.result, "build_command"), "&>/dev/null") : lookup(data.external.archive.result, "build_command") filename_old = lookup(null_resource.archive.triggers, "filename") filename_new = lookup(data.external.archive.result, "filename") module_relpath = path.module diff --git a/variables.tf b/variables.tf index 1b17bd5..4dd224a 100644 --- a/variables.tf +++ b/variables.tf @@ -17,6 +17,11 @@ variable "source_path" { type = string } +variable "silent" { + description = "True if the output from the build should be silent" + type = bool +} + # Optional variables specific to this module. variable "build_command" {