From d7480d6ab8ca7eb21698cf0c2688c533822d3192 Mon Sep 17 00:00:00 2001 From: James Cleverley-Prance Date: Wed, 23 Feb 2022 14:25:13 +0000 Subject: [PATCH] fix: ensure failed deployments return false cherry-picked from private/pull/16 --- terraform/modules/AWS/Bastion/test.tf | 1 + terraform/modules/AWS/InternalHost/test.tf | 1 + terraform/modules/AWS/Kubernetes/test.tf | 2 ++ terraform/modules/scripts/run-goss.sh | 4 +++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/terraform/modules/AWS/Bastion/test.tf b/terraform/modules/AWS/Bastion/test.tf index 5b1a7136..05e400f8 100644 --- a/terraform/modules/AWS/Bastion/test.tf +++ b/terraform/modules/AWS/Bastion/test.tf @@ -30,6 +30,7 @@ resource "null_resource" "bastion_test" { provisioner "remote-exec" { inline = [ + "set -o errexit", "chmod +x /root/run-goss.sh", "/root/run-goss.sh", "rm /root/run-goss.sh /root/goss.yaml", diff --git a/terraform/modules/AWS/InternalHost/test.tf b/terraform/modules/AWS/InternalHost/test.tf index 3bca5a9c..e5551020 100644 --- a/terraform/modules/AWS/InternalHost/test.tf +++ b/terraform/modules/AWS/InternalHost/test.tf @@ -26,6 +26,7 @@ resource "null_resource" "internal_host_test" { provisioner "remote-exec" { inline = [ + "set -o errexit", "chmod +x /root/run-goss.sh", "/root/run-goss.sh", "rm /root/run-goss.sh /root/goss.yaml", diff --git a/terraform/modules/AWS/Kubernetes/test.tf b/terraform/modules/AWS/Kubernetes/test.tf index cc8238bf..175d1ad7 100644 --- a/terraform/modules/AWS/Kubernetes/test.tf +++ b/terraform/modules/AWS/Kubernetes/test.tf @@ -31,6 +31,7 @@ resource "null_resource" "master_test" { provisioner "remote-exec" { inline = [ + "set -o errexit", "chmod +x /root/run-goss.sh", "/root/run-goss.sh", "rm /root/run-goss.sh /root/goss.yaml", @@ -71,6 +72,7 @@ resource "null_resource" "node_test" { provisioner "remote-exec" { inline = [ + "set -o errexit", "chmod +x /root/run-goss.sh", "/root/run-goss.sh", "rm /root/run-goss.sh /root/goss.yaml", diff --git a/terraform/modules/scripts/run-goss.sh b/terraform/modules/scripts/run-goss.sh index b8aea0b6..537f6a7c 100755 --- a/terraform/modules/scripts/run-goss.sh +++ b/terraform/modules/scripts/run-goss.sh @@ -20,7 +20,9 @@ readonly GOSS_VERSION=v0.3.7 main() { install_goss wait_for_cloud_init - goss validate -f documentation + goss validate -f documentation \ + --sleep 10s \ + --retry-timeout 120s } readonly -f main