Tweak fuse.conf after the fuse package is installed, not before.
[arvados-dev.git] / jenkins / packer-images / node-ready.sh
1 #!/bin/bash
2
3 # Copyright (C) The Arvados Authors. All rights reserved.
4 #
5 # SPDX-License-Identifier: Apache-2.0
6
7 # GCP nodes sometimes have no outbound working network for the first few
8 # seconds/minutes.
9 #
10 # This script will wait until git.arvados.org is reachable.
11 set -eo pipefail
12
13 # Send all stdout/stderr to the log and to the terminal
14 exec > >(tee -a /tmp/boot-wait.log) 2>&1
15
16 # Log a timestamp
17 date
18 echo "Starting node-ready.sh"
19
20 while ! /bin/nc -w1 -z git.arvados.org 22; do
21   echo "Connect failed, waiting 1 second..."
22   sleep 1
23 done
24 echo "Connected!"
25
26 # All set! Enable and start sshd so jenkins can start the agent...
27 echo "Re-enabling sshd..."
28 /bin/systemctl enable ssh || true
29 echo "Starting sshd..."
30 /bin/systemctl start ssh || /bin/systemctl status ssh
31
32 echo "Completed node-ready.sh"
33 # Log a timestamp
34 date