-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
52 lines (45 loc) · 1.64 KB
/
Vagrantfile
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
SECRETS = YAML.load_file(File.expand_path(File.join(File.dirname(__FILE__), "./secrets.yml")))
def get_secret(key)
SECRETS.has_key?(key) ? SECRETS[key] : raise("Your secrets file is missing your #{key}")
end
BOX_NAME = ENV["BOX_NAME"] || "default"
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 8153, host: 8153
config.vm.network "forwarded_port", guest: 8154, host: 8154
config.vm.provider "virtualbox" do |v|
v.memory = 4096
v.cpus = 3
end
config.vm.provider :aws do |aws, override|
aws.access_key_id = get_secret("aws_access_key")
aws.secret_access_key = get_secret("aws_secret_key")
aws.region = "us-east-1"
aws.instance_type = "t2.medium"
aws.keypair_name = get_secret("aws_keypair_name")
aws.security_groups = ["sg-922328f5"]
aws.subnet_id = get_secret("aws_subnet_id")
aws.associate_public_ip = true
aws.ami = "ami-d05e75b8"
override.ssh.username = "ubuntu"
override.ssh.private_key_path = get_secret("local_aws_ssh_private_key_path")
override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
override.vm.box = "dummy"
override.nfs.functional = false
end
config.vm.define BOX_NAME do |box|
box.vm.provision "ansible" do |ansible|
ansible.sudo = true
ansible.limit = 'all'
ansible.playbook = "playbooks/roles/all.yml"
ansible.extra_vars = {
GOCD_ADMIN_EMAIL: '[email protected]',
CF_USERNAME: get_secret("cf_username"),
CF_PASSWORD: get_secret("cf_password")
}
end
end
end