-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
66 lines (51 loc) · 1.41 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'fileutils'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
CONFIG= "config.rb"
@vm_name = "gyazo"
@ip = "10.5.5.100"
# Vbox vm setting {
$vb_gui = false
$vb_memory = 512
$vb_cpus = 1
# }
if File.exist?(CONFIG)
require_relative CONFIG
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider :virtualbox do |vb|
vb.gui = $vb_gui
vb.memory = $vb_memory
vb.cpus = $vb_cpus
end
# plugin conflict
if Vagrant.has_plugin?("vagrant-vbguest") then
config.vbguest.auto_update = false
end
node_name = @vm_name
config.vm.define node_name do |server|
server.vm.hostname = node_name
server.vm.box = "hfm4/centos7"
server.vm.network :private_network, ip: @ip
end
def exec_playbook(book, config)
config.vm.provision "ansible" do |ansible|
ansible.playbook = "provisioning/#{book}.yml"
ansible.verbose = "vvvv"
case book
when "init"
#ansible.skip_tags = ["yum_updates", "yum_repos", "selinux"]
#ansible.skip_tags = ["yum_updates"]
when "gyazo"
#ansible.skip_tags = ["gem", "rbenv", "setup_rbenv"]
#ansible.skip_tags = ["setup_rbenv"]
#else
# break
end
#ansible.raw_arguments = ['--syntax-check']
end
end
['init', 'gyazo'].each {|p| exec_playbook(p, config)}
end