Add timeout to give instance enough time to boot

This commit is contained in:
Erik Stambaugh 2021-12-27 09:38:26 -08:00
parent f20c08ae22
commit fdb77a8699

View file

@ -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)"