Skip to content

Instantly share code, notes, and snippets.

@ibejohn818
Last active January 1, 2018 09:39
Show Gist options
  • Save ibejohn818/aa2bcd6743a59f62e1baa098d6365a61 to your computer and use it in GitHub Desktop.
Save ibejohn818/aa2bcd6743a59f62e1baa098d6365a61 to your computer and use it in GitHub Desktop.
Cloudformation-init-scripts
#!/usr/bin/env bash
if [ -d /etc/yum.repos.d ]; then
curl -L https://gist.github.com/ibejohn818/aa2bcd6743a59f62e1baa098d6365a61/raw/redhat-init.sh -o /tmp/redhat-install.sh
chmod +x /tmp/redhat-install.sh
/tmp/redhat-install.sh
/opt/aws/bin/cfn-signal --resource $1 --stack $2 --region $3
else
curl -L https://gist.github.com/ibejohn818/aa2bcd6743a59f62e1baa098d6365a61/raw/ubuntu-init.sh -o /tmp/ubuntu-install.sh
chmod +x /tmp/ubuntu-install.sh
/tmp/ubuntu-install.sh
/usr/local/bin/cfn-signal --resource $1 --stack $2 --region $3
fi
#!/usr/bin/env bash
yum install -y aws-cfn-bootstrap
#!/usr/bin/env bash
i=0
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
echo "[$i] Waiting for other software managers to finish..."
sleep 1
((i=i+1))
done
apt-get update
i=0
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
echo "[$i] Waiting for other software managers to finish..."
sleep 1
((i=i+1))
done
apt-get install -y python-setuptools
easy_install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz
# Send ASG Signal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment