-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathVagrantfile
38 lines (32 loc) · 1.25 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
# Load the shared config file
config_file = File.join(File.dirname(__FILE__), 'roles/cloyster_setup/vars/machines.yml')
config = YAML.load_file(config_file)
machines = config['machines']
specified_machines = ENV['MACHINES'].to_s.split(',')
Vagrant.configure("2") do |config|
config.vm.box_check_update = false
machines.each do |name, conf|
next unless specified_machines.empty? || specified_machines.include?(name)
config.vm.define "#{name}" do |m|
m.vm.box = "#{conf['box']}"
m.vm.network 'private_network', ip: "#{conf['vagrant_external_network_address']}", name: "external_network"
m.vm.network 'private_network', ip: "#{conf['vagrant_management_network_address']}", name: "management_network"
m.vm.hostname = "cloyster.hpc"
m.vm.provider 'libvirt' do |lv|
lv.memory = conf['memory']
lv.cpus = conf['cpus']
lv.host = 'localhost'
lv.driver = 'kvm'
lv.uri = 'qemu:///system'
end
m.vm.provision "ansible" do |ansible|
ansible.playbook = "roles/cloyster_setup/provision/#{conf['provision']}"
ansible.compatibility_mode = "2.0"
end
m.vm.synced_folder '.', '/vagrant', type: "rsync"
end
end
end