-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
38 lines (31 loc) · 1.17 KB
/
Rakefile
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
vagrant_plugins = { 'ansible' => '0.2.0' ,
'vagrant-cachier' => '1.1.0',
'vagrant-hostmanager' => '1.5.0',
'vagrant-triggers' => '0.4.3',
'vagrant-serverspec' => '0.1.0',
'vagrant-hostsupdater' => '0.0.11'}
ansible_roles = [ 'Azulinho.azulinho-google-dns']
task :default => ['setup', 'vagrant_up'] do
end
desc "let me sort out all the goodies you may need"
task :setup do
plugins_installed = `vagrant plugin list`
vagrant_plugins.each_pair do |name, version|
unless plugins_installed =~ /.*#{ name }.*#{version}.*/
system("vagrant plugin install #{ name } --plugin-version #{ version }")
end
end
system("cd vagrantbox && bundle install")
ansible_roles.each do |role|
unless Dir.exists?("vagrantbox/roles/#{role}")
system("cd vagrantbox && ansible-galaxy install #{ role } -p ./roles --force ")
end
end
end
desc "power up the vagrant boxes"
task :vagrant_up do
['AzulinhoDevelPackages'].each do |box|
system("cd vagrantbox && vagrant up #{ box } --no-provision")
end
system("cd vagrantbox && vagrant provision AzulinhoDevelPackages")
end