Skip to content

Commit

Permalink
packer: fix provision race-conditions following reboot
Browse files Browse the repository at this point in the history
I found out that periodically the GCE build fails after the reboot
action (part of the shell provision)
According to packer [0] it might be caused by race conditions between
the provisions and `pause_before` should be used in this case

> Sometimes, when executing a command like reboot, the shell script
will return and Packer will start executing the next one before SSH
actually quits and the machine restarts

If it's not gonna help I'll increase 10s>20s and add the ssh_read_write_timeout

[0] https://developer.hashicorp.com/packer/docs/provisioners/shell#handling-reboots
  • Loading branch information
benipeled committed Jun 15, 2023
1 parent 692f305 commit db75e41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packer/scylla.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@
{
"destination": "/home/{{user `ssh_username`}}/",
"source": "files/",
"type": "file"
"type": "file",
"pause_before": "10s"
},
{
"destination": "/home/{{user `ssh_username`}}/",
Expand Down

0 comments on commit db75e41

Please sign in to comment.