./priv/roles/Common.sh in stacco-0.1.27 vs ./priv/roles/Common.sh in stacco-0.1.28
- old
+ new
@@ -18,33 +18,17 @@
_exit_handler_reason="$1"
echo "error: $1" >&2
exit 1
}
-
set -e
-export HOME=/root
-cd "$HOME"
-cat >/usr/local/bin/run-gist <<EOF
- gist_id="\$1"; shift
- gist_download_url="https://gist.github.com/\${gist_id}/download"
- extract_dir=\$(mktemp -d /tmp/stacco.XXXXXXXX)
- echo "unpacking '\${gist_download_url}'..."
+export HOME=/root
+cd "$HOME"
- pushd "\${extract_dir}" >/dev/null
- curl -sL "\${gist_download_url}" | tar -x -z --strip=1
- chmod a+x ./run
- ./run
- popd >/dev/null
-
- rm -rf "\${extract_dir}"
-EOF
-chmod a+x /usr/local/bin/run-gist
-
echo "ensuring internet connectivity..."
curl -sL -I -o /dev/null --fail --show-error --retry 100 'http://bex-status.s3.amazonaws.com/status.json'
echo "found an internet connection."
echo "configuring hostname from aws metadata service"
@@ -57,31 +41,31 @@
cat >>/etc/hosts <<EOF
127.0.0.1 localhost
127.0.1.1 ${private_hostname} ${host_title} ${short_private_hostname}
EOF
-echo "adding vendor apt sources"
-apt-key adv --keyserver 'hkp://pgp.mit.edu:80' --recv-keys 'C43C79AD'
-echo "deb http://rep.logentries.com/ trusty main" > /etc/apt/sources.list.d/logentries.list
-
echo "enabling mirroring for security apt sources"
sed -i "s/security\.ubuntu\.com/${AWS_REGION}.ec2.archive.ubuntu.com/g" /etc/apt/sources.list
echo "disablng kernel and initramfs updates"
echo $(dpkg -l "*$(uname -r)*" | grep image | awk '{print $2}') hold | dpkg --set-selections
sed -i 's/=yes/=no/g' /etc/initramfs-tools/update-initramfs.conf
+echo "adding vendor apt sources"
+apt-key adv --keyserver 'hkp://pgp.mit.edu:80' --recv-keys 'C43C79AD'
+echo "deb http://rep.logentries.com/ trusty main" > /etc/apt/sources.list.d/logentries.list
+
echo "installing packages"
apt-get clean
apt-get update
apt-get upgrade -qy
apt-get install -qy python-setuptools python-pip python-setproctitle htop tree btrfs-tools xz-utils logentries bundler ruby-nokogiri
pip install -q awscli
gem install -q --no-rdoc --no-ri aws-sdk docker-utils
if [ -n "$LOGENTRIES_ACCOUNT_KEY" ]; then
echo "starting remote logging"
- agent_key=$(docker-utils get-host-uuid "${AWS_INSTANCE_LOGICAL_NAME}.${AWS_STACK_NAME}")
+ host_key=$(docker-utils get-host-uuid "${AWS_INSTANCE_LOGICAL_NAME}.${AWS_STACK_NAME}")
le init --account-key="${LOGENTRIES_ACCOUNT_KEY}" --agent-key="${host_key}"
le register --force --name="${host_title}" --hostname="${private_hostname}"
apt-get install -qy logentries-daemon 2>/dev/null || :
logs_to_follow="syslog messages dmesg auth.log boot.log daemon.log dpkg.log kern.log cron secure faillog cloud-init-output.log"