19215: Adds initial version of terraform code for multi-host deploy in AWS.
[arvados.git] / tools / salt-install / terraform / aws / services / user_data.sh
diff --git a/tools/salt-install/terraform/aws/services/user_data.sh b/tools/salt-install/terraform/aws/services/user_data.sh
new file mode 100644 (file)
index 0000000..6c5b574
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: CC-BY-SA-3.0
+
+hostname ${hostname}
+echo ${hostname} > /etc/hostname
+
+# Retry just in case internet access is not yet ready
+while true; do
+  apt-get -o Acquire::ForceIPv4=true update
+  ERR=$?
+  if [ "$${ERR}" = "0" ]; then
+    break
+  fi
+done
+
+apt-get -o Acquire::ForceIPv4=true install -y git curl