-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathVagrantfile_aws
More file actions
70 lines (59 loc) · 2.25 KB
/
Vagrantfile_aws
File metadata and controls
70 lines (59 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
#
# Install the vagrant-aws plugin before using this file, to be found on
#
# https://github.com/mitchellh/vagrant-aws
#
Vagrant.configure(2) do |config|
# Use a dummy box, since aws-provider will just copy an already existing AMI.
# Do
#
# vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box
#
# to install the dummy box, then:
config.vm.box = "dummy"
# config.vm.network "forwarded_port", guest: 80, host: 8080
# config.vm.network "forwarded_port", guest: 8002, host: 3691
#
# WARNING: vagrant cannot do AWS networking for you. Enable portforwarding on
# AWS page.
config.vm.provider :aws do |aws, override|
# This are your AWS credentials from the page:
aws.access_key_id = "ACCESS_KEY_ID"
aws.secret_access_key = "SECRET_ACCESS_KEY"
# Create this on the aws page. The file you download goes into the second
# entry. The keypair name is the name you enter when generating the key,
# the path is the location of the file you download when generating the
# key.
aws.keypair_name = "KEYPAIR_NAME"
override.ssh.private_key_path = "PRIVATE_KEY_PATH"
# Find these on the AWS page, using the 'launch instance' dialogue.
aws.ami = "ami-d05e75b8"
aws.instance_type = "t2.micro"
# Region on the AWS page at upper right.
aws.region = "us-east-1"
# Default username for ubuntu machine.
override.ssh.username = "ubuntu"
end
#
# Third line since username is already given by aim.
config.vm.provision "shell", privileged:false, inline: <<-SHELL
sudo apt-get update && apt-get upgrade -y
sudo apt-get install -y nodejs npm wget
sudo ln -s /home/ubuntu /home/vagrant
wget -qO- https://get.docker.com/ | sh
sudo ln -s /usr/bin/nodejs /usr/bin/node
git clone https://github.com/fhinkel/InteractiveShell.git
cd InteractiveShell
npm install
git pull --no-verify
rm id_rsa*
ssh-keygen -b 1024 -f id_rsa -P ''
sudo docker build -t m2container .
SHELL
end