Add locales and unzip to install deps
[arvados.git] / tools / salt-install / terraform / aws / services / user_data.sh
1 #!/bin/sh
2
3 # Copyright (C) The Arvados Authors. All rights reserved.
4 #
5 # SPDX-License-Identifier: CC-BY-SA-3.0
6
7 hostname ${hostname}
8 echo ${hostname} > /etc/hostname
9
10 # Retry just in case internet access is not yet ready
11 while true; do
12   apt-get -o Acquire::ForceIPv4=true update
13   ERR=$?
14   if [ "$${ERR}" = "0" ]; then
15     break
16   fi
17 done
18
19 apt-get -o Acquire::ForceIPv4=true install -y git curl
20
21 SSH_DIR="/home/${deploy_user}/.ssh"
22 if [ ! -d "$${SSH_DIR}" ]; then
23   install -d -o ${deploy_user} -g ${deploy_user} -m 700 $${SSH_DIR}
24 fi
25 echo "${ssh_pubkey}" | install -o ${deploy_user} -g ${deploy_user} -m 600 /dev/stdin $${SSH_DIR}/authorized_keys