-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
67 lines (56 loc) · 1.93 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'vagrant-azure'
# Azure information
TENANT_ID = ENV['AZURE_TENANT_ID']
CLIENT_ID = ENV['AZURE_CLIENT_ID']
CLIENT_SECRET = ENV['AZURE_CLIENT_SECRET']
SUBSCRIPTION_ID = ENV['AZURE_SUBSCRIPTION_ID']
# VM specification
VM_SIZE="Standard_B1s"
LOCATION="francecentral"
RESOURCE_GROUP="vagrant-info"
SERVER_NAME="vagrant-server"
DB_NAME="vagrant-data"
IMAGE="Canonical:UbuntuServer:16.04-LTS:latest"
Vagrant.configure("2") do |config|
config.vm.define 'data' do |server|
server.vm.box = 'azure'
server.vm.provider :azure do |az, override|
az.tenant_id = TENANT_ID
az.client_id = CLIENT_ID
az.client_secret = CLIENT_SECRET
az.subscription_id = SUBSCRIPTION_ID
az.vm_name = DB_NAME
az.vm_size = VM_SIZE
az.vm_image_urn = IMAGE
az.tcp_endpoints = 27017 # Allow MongoDB Connections
az.location = LOCATION
az.resource_group_name = RESOURCE_GROUP
end
server.vm.provision "ansible" do |ansible|
ansible.compatibility_mode = "2.0"
ansible.playbook = "./provision/data_playbook.yml"
end
end
config.vm.define 'server' do |server|
server.vm.box = 'azure'
server.vm.provider :azure do |az, override|
az.tenant_id = TENANT_ID
az.client_id = CLIENT_ID
az.client_secret = CLIENT_SECRET
az.subscription_id = SUBSCRIPTION_ID
az.vm_name = SERVER_NAME
az.vm_size = VM_SIZE
az.vm_image_urn = IMAGE
az.tcp_endpoints = 80 # Webservice entry point
az.location = LOCATION
az.resource_group_name = RESOURCE_GROUP
end
server.vm.provision "ansible" do |ansible|
ansible.compatibility_mode = "2.0"
ansible.playbook = "./provision/server_playbook.yml"
end
end
config.ssh.private_key_path = '~/.ssh/id_rsa'
end