vagrant-foodtaster-server 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -27,25 +27,26 @@ class VagrantFoodtasterServer
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def prepare_vm(vm_name)
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
chef_run_list = get_chef_solo_run_list(vm)
|
34
|
-
provision_types = [:shell, :puppet]
|
30
|
+
unless vm_prepared?(vm_name)
|
31
|
+
vm = get_vm(vm_name)
|
32
|
+
sahara = sahara_for(vm)
|
35
33
|
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
if vm.state.id.to_s != 'running'
|
35
|
+
chef_run_list = get_chef_solo_run_list(vm)
|
36
|
+
provision_types = [:shell, :puppet]
|
39
37
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
38
|
+
unless chef_run_list.empty?
|
39
|
+
provision_types << :chef_solo
|
40
|
+
end
|
44
41
|
|
45
|
-
|
42
|
+
vm.action(:up,
|
43
|
+
provision_types: provision_types,
|
44
|
+
provision_enabled: true)
|
45
|
+
end
|
46
46
|
|
47
|
-
|
48
|
-
|
47
|
+
unless sahara.is_snapshot_mode_on?
|
48
|
+
sahara.on
|
49
|
+
end
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
@@ -65,6 +66,13 @@ class VagrantFoodtasterServer
|
|
65
66
|
@env.machine_names.include?(vm_name)
|
66
67
|
end
|
67
68
|
|
69
|
+
def vm_prepared?(vm_name)
|
70
|
+
vm = get_vm(vm_name)
|
71
|
+
sahara = sahara_for(vm)
|
72
|
+
|
73
|
+
vm.state.id.to_s == 'running' && sahara.is_snapshot_mode_on?
|
74
|
+
end
|
75
|
+
|
68
76
|
def run_chef_on_vm(vm_name, current_run_config)
|
69
77
|
vm = get_vm(vm_name)
|
70
78
|
|