Skip to content

Commit

Permalink
Limit ssh file check to 10
Browse files Browse the repository at this point in the history
  • Loading branch information
jawabuu committed May 16, 2021
1 parent 384c80b commit e17df3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ssh/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ data "external" "ssh_keys" {
create_ssh_keys = join(" ", null_resource.create_ssh_keys.*.id)
}
program = ["bash", "-c", <<-EOF
while ! test -f ${var.ssh_pubkey_path}; do echo 'waiting for keys..'; sleep 5; done
while ! test -f ${var.ssh_pubkey_path}; do echo 'waiting for keys..'; ((c++)) && ((c==10)) && break; sleep 5; done
echo "{\"private_key\":\"${var.ssh_key_path}\",\"public_key\":\"${var.ssh_pubkey_path}\"}"
EOF
]
Expand Down

0 comments on commit e17df3b

Please sign in to comment.