From fdb77a86991c4e4fa905ff7618f67d2124caa60c Mon Sep 17 00:00:00 2001 From: Erik Stambaugh Date: Mon, 27 Dec 2021 09:38:26 -0800 Subject: [PATCH] Add timeout to give instance enough time to boot --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 75c9428..d6b6b81 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ default: terraform ansible ssh_setup: chmod 600 privkey.pem $(eval INSTANCE := $(shell terraform output instance_id | sed -e 's/"//g')) + timeout 300 bash -c -- 'until $(SSH) $(INSTANCE) "/bin/true"; do sleep 0.5; done' ansible: ssh_setup $(SSH) $(INSTANCE) "which -a ansible || (sudo apt-get update && sudo apt-get -y install ansible)"