Sha256: 023bee540d31186576bfced7e693db333860eae8aa2188a202a6855c892d8452

Contents?: true

Size: 1.33 KB

Versions: 5

Compression:

Stored size: 1.33 KB

Contents

#!/bin/bash -lexv
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1

FIND_IN_MAP=<%= find_in_map("MapName", "TopLevelKey", "SecondLevelKey") %>
HOSTNAME_PREFIX=<%= find_in_map("EnvironmentMapping", "HostnamePrefix", ref("Environment")) %>
BAR=<%= ref("DRINK") %> ; MORE=<%= find_in_map("MapName", "TopLevelKey", "SecondLevelKey") %>

BASE64=<%= base64("value to encode") %>
GET_ATT=<%= get_att("server", "PublicDnsName") %>
GET_AZS=<%= get_azs %>
JOIN=<%= join(":", ['a','b','c']) %>
SELECT=<%= select("1", ['a','b','c']) %>

echo <%= ref("AWS::StackName") %> > /tmp/stack_name
# Helper function
function error_exit
{
  /usr/local/bin/cfn-signal -e 1 -r "$1" '<%= ref("WaitHandle") %>'
exit 1
}
# Wait for the EBS volume to show up
while [ ! -e /dev/xvdf ]; do echo Waiting for EBS volume to attach; sleep 1; done
/bin/mkdir /media/redis
/sbin/mkfs -t ext4 /dev/xvdf
echo "/dev/xvdf /media/redis auto defaults 0 0" >> /etc/fstab
/bin/mount /media/redis
/usr/bin/redis-cli shutdown
sleep 10
mv /var/lib/redis/* /media/redis/
rm -r /var/lib/redis
ln -s /media/redis /var/lib/redis
chown -R redis:redis /var/lib/redis
chown -R redis:redis /media/redis
/usr/bin/redis-server
# If all is well so signal success
/usr/local/bin/cfn-signal -e $? -r "Ready to rock" '<%= ref("WaitHandle") %>'
cat /proc/uptime | cut -f1 -d'.' > /tmp/time-to-boot

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lono-0.3.4 lib/starter_project/templates/user_data/db.sh.erb
lono-0.3.3 lib/starter_project/templates/user_data/db.sh.erb
lono-0.3.2 lib/starter_project/templates/user_data/db.sh.erb
lono-0.3.1 lib/starter_project/templates/user_data/db.sh.erb
lono-0.3.0 lib/starter_project/templates/user_data/db.sh.erb