forked from redhat-beyond/beyond
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
71 lines (59 loc) · 2.36 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
class Hash
def slice(*keep_keys)
h = {}
keep_keys.each { |key| h[key] = fetch(key) if has_key?(key) }
h
end unless Hash.method_defined?(:slice)
def except(*less_keys)
slice(*keys - less_keys)
end unless Hash.method_defined?(:except)
end
# Specify minimum Vagrant version
Vagrant.require_version '= 2.2.10'
Vagrant.configure("2") do |config|
config.vagrant.plugins= ["vagrant-env", "vagrant-docker-compose"]
config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: [ "venv/", ".git/", ".idea/" ]
config.vm.provision :docker
config.vm.provision :docker_compose, yml: "/vagrant/docker-compose.yml", rebuild: true, run: "always",
compose_version: "1.28.2"
config.env.enable
config.vm.define "dev" do |dev|
dev.vm.box = "bento/ubuntu-18.04"
dev.vm.network "forwarded_port", guest: 5000, host: 5000
dev.vm.provision "file", source: "./ssh-keys", destination: "/home/vagrant/.ssh/authorized_keys"
end
config.vm.define "stage" do |stage|
stage.vm.box = "dummy"
stage.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
stage.vm.provider :aws do |aws,override|
override.nfs.functional = false
aws.aws_profile = ENV['PROFILE_STAGE']
aws.keypair_name = ENV['KEY_NAME_STAGE']
aws.ami = ENV['AMI_STAGE']
aws.instance_type = ENV['INSTANCE_TYPE_STAGE']
aws.region = ENV['REGION_STAGE']
aws.subnet_id = ENV['SUBNET_ID_STAGE']
aws.security_groups = ENV['SECURITY_GROUPS_STAGE']
aws.associate_public_ip = true
override.ssh.username = ENV['USERNAME_STAGE']
override.ssh.private_key_path = ENV['PRIVATE_KEY_PATH_STAGE']
end
end
config.vm.define "prod" do |prod|
prod.vm.box = "dummy"
prod.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
prod.vm.provider :aws do |aws,override|
override.nfs.functional = false
aws.aws_profile = ENV['PROFILE_PROD']
aws.keypair_name = ENV['KEY_NAME_PROD']
aws.ami = ENV['AMI_PROD']
aws.instance_type = ENV['INSTANCE_TYPE_PROD']
aws.region = ENV['REGION_PROD']
aws.subnet_id = ENV['SUBNET_ID_PROD']
aws.security_groups = ENV['SECURITY_GROUPS_PROD']
aws.elastic_ip = ENV['ELASTIC_IP']
override.ssh.username = ENV['USERNAME_PROD']
override.ssh.private_key_path = ENV['PRIVATE_KEY_PATH_PROD']
end
end
end