Skip to content

Commit 5b16fb0

Browse files
committed
Tweaks: 16.04
1 parent 450ab1a commit 5b16fb0

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

new_launch_config.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
aws autoscaling create-launch-configuration --launch-configuration-name $1 --image-id $2 --instance-type t2.medium --associate-public-ip-address --iam-instance-profile XaniaBlog --security-groups sg-99df30fd --key-name mattgodbolt --block-device-mappings '[{ "DeviceName": "/dev/sda1", "Ebs": {"VolumeSize": 16, "VolumeType":"gp2", "DeleteOnTermination": true}}]' --instance-monitoring Enabled=False
3+
aws autoscaling create-launch-configuration --launch-configuration-name $1 --image-id $2 --instance-type t2.medium --associate-public-ip-address --iam-instance-profile XaniaBlog --security-groups sg-99df30fd --key-name mattgodbolt --block-device-mappings '[{ "DeviceName": "/dev/sda1", "Ebs": {"VolumeSize": 8, "VolumeType":"gp2", "DeleteOnTermination": true}}]' --instance-monitoring Enabled=False

packer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"region": "us-east-1",
66
"access_key": "{{user `MY_ACCESS_KEY`}}",
77
"secret_key": "{{user `MY_SECRET_KEY`}}",
8-
"source_ami": "ami-49c9295f",
8+
"source_ami": "ami-80861296",
99
"instance_type": "t2.medium",
1010
"ssh_username": "ubuntu",
11-
"ami_name": "compiler-explorer packer {{timestamp}}",
11+
"ami_name": "compiler-explorer packer 16.04 @ {{timestamp}}",
1212
"associate_public_ip_address": true,
1313
"iam_instance_profile": "XaniaBlog",
1414
"vpc_id": "vpc-17209172",
@@ -25,7 +25,7 @@
2525
"launch_block_device_mappings": [
2626
{
2727
"device_name": "/dev/sda1",
28-
"volume_size": 9,
28+
"volume_size": 8,
2929
"delete_on_termination": true,
3030
"volume_type": "standard"
3131
}

setup.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ fi
1414
if [[ ! -f /updated ]]; then
1515
apt-get -y update
1616
apt-get -y upgrade --force-yes
17+
apt-get -y install unzip libwww-perl libdatetime-perl nfs-common
18+
curl -sL http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip -o /tmp/cwm.zip
19+
cd /root
20+
unzip /tmp/cwm.zip
21+
rm /tmp/cwm.zip
22+
echo '*/5 * * * * /root/aws-scripts-mon/mon-put-instance-data.pl ' \
23+
'--mem-util --disk-space-util --disk-path=/ --from-cron' >> /etc/crontab
1724
touch /updated
1825
fi
1926

@@ -61,9 +68,7 @@ docker stop logspout || true
6168
docker rm logspout || true
6269
docker run --name logspout -d -v=/var/run/docker.sock:/tmp/docker.sock -h $(hostname) gliderlabs/logspout syslog://logs2.papertrailapp.com:34474
6370

64-
mountpoint -q /opt || mount -t nfs4 -o nfsvers=4.1 $(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).fs-db4c8192.efs.us-east-1.amazonaws.com:/ /opt &
65-
66-
apt-get -y install git make libpng-dev m4 perl nfs-common
71+
mountpoint -q /opt || mount -t nfs4 -o nfsvers=4.1,ro $(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).fs-db4c8192.efs.us-east-1.amazonaws.com:/ /opt &
6772

6873
cd /home/ubuntu/
6974

0 commit comments

Comments
 (0)