chef-provisioning 0.19 → 0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +62 -32
- data/lib/chef/provider/load_balancer.rb +18 -8
- data/lib/chef/provider/machine.rb +11 -7
- data/lib/chef/provider/machine_batch.rb +8 -4
- data/lib/chef/provider/machine_execute.rb +1 -1
- data/lib/chef/provider/machine_image.rb +46 -14
- data/lib/chef/provisioning.rb +9 -1
- data/lib/chef/provisioning/chef_managed_entry_store.rb +128 -0
- data/lib/chef/provisioning/chef_run_data.rb +9 -16
- data/lib/chef/provisioning/convergence_strategy/install_cached.rb +25 -7
- data/lib/chef/provisioning/convergence_strategy/install_msi.rb +26 -8
- data/lib/chef/provisioning/convergence_strategy/install_sh.rb +28 -6
- data/lib/chef/provisioning/driver.rb +28 -21
- data/lib/chef/provisioning/load_balancer_spec.rb +6 -71
- data/lib/chef/provisioning/machine_image_spec.rb +34 -0
- data/lib/chef/provisioning/machine_spec.rb +23 -47
- data/lib/chef/provisioning/managed_entry.rb +121 -0
- data/lib/chef/provisioning/managed_entry_store.rb +136 -0
- data/lib/chef/provisioning/recipe_dsl.rb +0 -4
- data/lib/chef/provisioning/version.rb +1 -1
- data/lib/chef/resource/chef_data_bag_resource.rb +1 -2
- data/lib/chef/resource/load_balancer.rb +1 -0
- data/lib/chef/resource/machine.rb +1 -1
- data/lib/chef/resource/machine_batch.rb +2 -2
- data/lib/chef/resource/machine_execute.rb +2 -1
- metadata +7 -8
- data/lib/chef/provisioning/chef_image_spec.rb +0 -111
- data/lib/chef/provisioning/chef_load_balancer_spec.rb +0 -108
- data/lib/chef/provisioning/chef_machine_spec.rb +0 -83
- data/lib/chef/provisioning/image_spec.rb +0 -72
data/lib/chef/provisioning.rb
CHANGED
@@ -3,6 +3,7 @@ require 'chef/provisioning/recipe_dsl'
|
|
3
3
|
require 'chef/server_api'
|
4
4
|
require 'cheffish/basic_chef_client'
|
5
5
|
require 'cheffish/merged_config'
|
6
|
+
require 'chef/provisioning/chef_managed_entry_store'
|
6
7
|
|
7
8
|
class Chef
|
8
9
|
module Provisioning
|
@@ -53,6 +54,9 @@ module Provisioning
|
|
53
54
|
end
|
54
55
|
end
|
55
56
|
driver_class = @@registered_driver_classes[scheme]
|
57
|
+
if !driver_class
|
58
|
+
raise "chef/provisioning/driver_init/#{scheme} did not register a driver class for #{scheme.inspect}! Perhaps you have the case (uppercase or lowercase) wrong?"
|
59
|
+
end
|
56
60
|
|
57
61
|
#
|
58
62
|
# Merge in any driver-specific config
|
@@ -82,7 +86,7 @@ module Provisioning
|
|
82
86
|
def self.connect_to_machine(machine_spec, config = Cheffish.profiled_config)
|
83
87
|
chef_server = Cheffish.default_chef_server(config)
|
84
88
|
if machine_spec.is_a?(String)
|
85
|
-
machine_spec =
|
89
|
+
machine_spec = chef_managed_entry_store(chef_server).get(:machine, machine_spec)
|
86
90
|
end
|
87
91
|
driver = driver_for_url(machine_spec.driver_url, config)
|
88
92
|
if driver
|
@@ -93,6 +97,10 @@ module Provisioning
|
|
93
97
|
nil
|
94
98
|
end
|
95
99
|
end
|
100
|
+
|
101
|
+
def self.chef_managed_entry_store(chef_server = Cheffish.default_chef_server)
|
102
|
+
Provisioning::ChefManagedEntryStore.new(chef_server)
|
103
|
+
end
|
96
104
|
end
|
97
105
|
end
|
98
106
|
|
@@ -0,0 +1,128 @@
|
|
1
|
+
require 'chef/provisioning/managed_entry_store'
|
2
|
+
require 'cheffish'
|
3
|
+
|
4
|
+
class Chef
|
5
|
+
module Provisioning
|
6
|
+
class ChefManagedEntryStore < ManagedEntryStore
|
7
|
+
def initialize(chef_server = Cheffish.default_chef_server)
|
8
|
+
@chef_server = chef_server
|
9
|
+
end
|
10
|
+
|
11
|
+
attr_reader :chef_server
|
12
|
+
|
13
|
+
def chef_api
|
14
|
+
@chef_api ||= Cheffish.chef_server_api(chef_server)
|
15
|
+
end
|
16
|
+
|
17
|
+
#
|
18
|
+
# Get the given data
|
19
|
+
#
|
20
|
+
# @param resource_type [Symbol] The type of thing to retrieve (:machine, :machine_image, :load_balancer, :aws_vpc, :aws_subnet, ...)
|
21
|
+
# @param name [String] The unique identifier of the thing to retrieve
|
22
|
+
#
|
23
|
+
# @return [Hash,Array] The data, or `nil` if the data does not exist. Will be JSON- and YAML-compatible (Hash, Array, String, Integer, Boolean, Nil)
|
24
|
+
#
|
25
|
+
def get_data(resource_type, name)
|
26
|
+
begin
|
27
|
+
if resource_type == :machine
|
28
|
+
chef_api.get("nodes/#{name}")
|
29
|
+
else
|
30
|
+
chef_api.get("data/#{resource_type}/#{name}")
|
31
|
+
end
|
32
|
+
rescue Net::HTTPServerException => e
|
33
|
+
if e.response.code == '404'
|
34
|
+
backcompat_type = ChefManagedEntryStore.type_names_for_backcompat[resource_type]
|
35
|
+
if backcompat_type && backcompat_type != resource_type
|
36
|
+
get_data(backcompat_type, name)
|
37
|
+
else
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
else
|
41
|
+
raise
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Save the given data
|
48
|
+
#
|
49
|
+
# @param resource_type [Symbol] The type of thing to save (:machine, :machine_image, :load_balancer, :aws_vpc, :aws_subnet ...)
|
50
|
+
# @param name [String] The unique identifier of the thing to save
|
51
|
+
# @param data [Hash,Array] The data to save. Must be JSON- and YAML-compatible (Hash, Array, String, Integer, Boolean, Nil)
|
52
|
+
#
|
53
|
+
def save_data(resource_type, name, data, action_handler)
|
54
|
+
_chef_server = self.chef_server
|
55
|
+
Chef::Provisioning.inline_resource(action_handler) do
|
56
|
+
if resource_type == :machine
|
57
|
+
chef_node name do
|
58
|
+
chef_server _chef_server
|
59
|
+
raw_json data
|
60
|
+
end
|
61
|
+
else
|
62
|
+
chef_data_bag resource_type.to_s do
|
63
|
+
chef_server _chef_server
|
64
|
+
end
|
65
|
+
chef_data_bag_item name do
|
66
|
+
chef_server _chef_server
|
67
|
+
data_bag resource_type.to_s
|
68
|
+
raw_data data
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
backcompat_type = ChefManagedEntryStore.type_names_for_backcompat[resource_type]
|
74
|
+
if backcompat_type && backcompat_type != resource_type
|
75
|
+
delete_data(backcompat_type, name, action_handler)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
#
|
80
|
+
# Delete the given data
|
81
|
+
#
|
82
|
+
# @param resource_type [Symbol] The type of thing to delete (:machine, :machine_image, :load_balancer, :aws_vpc, :aws_subnet, ...)
|
83
|
+
# @param name [String] The unique identifier of the thing to delete
|
84
|
+
#
|
85
|
+
# @return [Boolean] Whether anything was deleted or not.
|
86
|
+
#
|
87
|
+
def delete_data(resource_type, name, action_handler)
|
88
|
+
_chef_server = self.chef_server
|
89
|
+
Chef::Provisioning.inline_resource(action_handler) do
|
90
|
+
if resource_type == :machine
|
91
|
+
chef_node name do
|
92
|
+
chef_server _chef_server
|
93
|
+
action :delete
|
94
|
+
end
|
95
|
+
else
|
96
|
+
chef_data_bag_item name do
|
97
|
+
chef_server _chef_server
|
98
|
+
data_bag resource_type.to_s
|
99
|
+
action :delete
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
backcompat_type = ChefManagedEntryStore.type_names_for_backcompat[resource_type]
|
105
|
+
if backcompat_type && backcompat_type != resource_type
|
106
|
+
delete_data(backcompat_type, name, action_handler)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def identifier(resource_type, name)
|
111
|
+
if resource_type == :machine
|
112
|
+
File.join(chef_server[:chef_server_url], "nodes", name)
|
113
|
+
else
|
114
|
+
File.join(chef_server[:chef_server_url], "data", resource_type.to_s, name)
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
#
|
119
|
+
# A list of the name that we used to use to store a given type before we
|
120
|
+
# standardized on "just use the resource name so we don't create collisions."
|
121
|
+
# Will be used to look up the old data.
|
122
|
+
#
|
123
|
+
def self.type_names_for_backcompat
|
124
|
+
@@type_names_for_backcompat ||= {}
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'chef/mixin/deep_merge'
|
2
2
|
require 'cheffish/merged_config'
|
3
|
-
require 'chef/provisioning/chef_machine_spec'
|
4
3
|
|
5
4
|
class Chef
|
6
5
|
module Provisioning
|
@@ -17,7 +16,6 @@ module Provisioning
|
|
17
16
|
attr_accessor :current_machine_options
|
18
17
|
attr_accessor :current_load_balancer_options
|
19
18
|
attr_accessor :current_image_options
|
20
|
-
attr_accessor :current_data_center
|
21
19
|
|
22
20
|
def with_machine_options(value)
|
23
21
|
old_value = self.current_machine_options
|
@@ -43,26 +41,21 @@ module Provisioning
|
|
43
41
|
end
|
44
42
|
end
|
45
43
|
|
46
|
-
def
|
47
|
-
|
48
|
-
|
44
|
+
def with_driver(driver, options = nil, &block)
|
45
|
+
if drivers[driver] && options
|
46
|
+
raise "Driver #{driver} has already been created, options #{options} would be ignored!"
|
47
|
+
end
|
48
|
+
old_driver, old_options = @current_driver, @current_driver_options
|
49
|
+
@current_driver, @current_driver_options = driver, options
|
49
50
|
if block_given?
|
50
51
|
begin
|
51
52
|
yield
|
52
53
|
ensure
|
53
|
-
|
54
|
+
@current_driver, @current_driver_options = old_driver, old_options
|
54
55
|
end
|
55
56
|
end
|
56
57
|
end
|
57
58
|
|
58
|
-
def with_driver(driver, options = nil, &block)
|
59
|
-
if drivers[driver] && options
|
60
|
-
raise "Driver #{driver} has already been created, options #{options} would be ignored!"
|
61
|
-
end
|
62
|
-
@current_driver = driver
|
63
|
-
@current_driver_options = options
|
64
|
-
end
|
65
|
-
|
66
59
|
def current_driver
|
67
60
|
@current_driver || config[:driver]
|
68
61
|
end
|
@@ -92,10 +85,10 @@ module Provisioning
|
|
92
85
|
end
|
93
86
|
|
94
87
|
def connect_to_machine(name, chef_server = nil)
|
95
|
-
if name.is_a?(
|
88
|
+
if name.is_a?(ManagedEntry)
|
96
89
|
machine_spec = name
|
97
90
|
else
|
98
|
-
machine_spec =
|
91
|
+
machine_spec = Provisioning.chef_managed_entry_store(chef_server).get(:machine, name)
|
99
92
|
end
|
100
93
|
Chef::Provisioning.connect_to_machine(machine_spec, config)
|
101
94
|
end
|
@@ -42,14 +42,32 @@ module Provisioning
|
|
42
42
|
def setup_convergence(action_handler, machine)
|
43
43
|
super
|
44
44
|
|
45
|
-
#
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
45
|
+
# Check for existing chef client.
|
46
|
+
version = machine.execute_always('chef-client -v')
|
47
|
+
|
48
|
+
# Don't do install/upgrade if a chef client exists and
|
49
|
+
# no chef version is defined by user configs or
|
50
|
+
# the chef client's version already matches user config
|
51
|
+
if version.exitstatus == 0
|
52
|
+
version = version.stdout.strip
|
53
|
+
if !chef_version
|
54
|
+
return
|
55
|
+
elsif version =~ /Chef: #{chef_version}$/
|
56
|
+
Chef::Log.debug "Already installed chef version #{version}"
|
57
|
+
return
|
58
|
+
elsif version.include?(chef_version)
|
59
|
+
Chef::Log.warn "Installed chef version #{version} contains desired version #{chef_version}. " +
|
60
|
+
"If you see this message on consecutive chef runs tighten your desired version constraint to prevent " +
|
61
|
+
"multiple convergence."
|
62
|
+
end
|
52
63
|
end
|
64
|
+
|
65
|
+
# Install chef client
|
66
|
+
platform, platform_version, machine_architecture = machine.detect_os(action_handler)
|
67
|
+
package_file = download_package_for_platform(action_handler, machine, platform, platform_version, machine_architecture)
|
68
|
+
remote_package_file = "#{@tmp_dir}/#{File.basename(package_file)}"
|
69
|
+
machine.upload_file(action_handler, package_file, remote_package_file)
|
70
|
+
install_package(action_handler, machine, remote_package_file)
|
53
71
|
end
|
54
72
|
|
55
73
|
def converge(action_handler, machine)
|
@@ -28,15 +28,33 @@ module Provisioning
|
|
28
28
|
|
29
29
|
super
|
30
30
|
|
31
|
-
#
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
31
|
+
# Check for existing chef client.
|
32
|
+
version = machine.execute_always('chef-client -v')
|
33
|
+
|
34
|
+
# Don't do install/upgrade if a chef client exists and
|
35
|
+
# no chef version is defined by user configs or
|
36
|
+
# the chef client's version already matches user config
|
37
|
+
if version.exitstatus == 0
|
38
|
+
version = version.stdout.strip
|
39
|
+
if !chef_version
|
40
|
+
return
|
41
|
+
elsif version =~ /Chef: #{chef_version}$/
|
42
|
+
Chef::Log.debug "Already installed chef version #{version}"
|
43
|
+
return
|
44
|
+
elsif version.include?(chef_version)
|
45
|
+
Chef::Log.warn "Installed chef version #{version} contains desired version #{chef_version}. " +
|
46
|
+
"If you see this message on consecutive chef runs tighten your desired version constraint to prevent " +
|
47
|
+
"multiple convergence."
|
48
|
+
end
|
39
49
|
end
|
50
|
+
|
51
|
+
# Install chef client
|
52
|
+
# TODO ssh verification of install.msi before running arbtrary code would be nice?
|
53
|
+
# TODO find a way to cache this on the host like with the Unix stuff.
|
54
|
+
# Limiter is we don't know how to efficiently upload large files to
|
55
|
+
# the remote machine with WMI.
|
56
|
+
machine.execute(action_handler, "(New-Object System.Net.WebClient).DownloadFile(#{machine.escape(install_msi_url)}, #{machine.escape(install_msi_path)})")
|
57
|
+
machine.execute(action_handler, "msiexec /qn /i #{machine.escape(install_msi_path)}")
|
40
58
|
end
|
41
59
|
|
42
60
|
def converge(action_handler, machine)
|
@@ -39,13 +39,35 @@ module Provisioning
|
|
39
39
|
def setup_convergence(action_handler, machine)
|
40
40
|
super
|
41
41
|
|
42
|
-
#
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
42
|
+
# Check for existing chef client.
|
43
|
+
version = machine.execute_always('chef-client -v')
|
44
|
+
|
45
|
+
# Don't do install/upgrade if a chef client exists and
|
46
|
+
# no chef version is defined by user configs or
|
47
|
+
# the chef client's version already matches user config
|
48
|
+
if version.exitstatus == 0
|
49
|
+
version = version.stdout.strip
|
50
|
+
if !chef_version
|
51
|
+
return
|
52
|
+
# This logic doesn't cover the case for a client with 12.0.1.dev.0 => 12.0.1
|
53
|
+
# so we decided to just use exact version for the time being (see comments in PR 303)
|
54
|
+
#elsif version.stdout.strip =~ /Chef: #{chef_version}([^0-9]|$)/
|
55
|
+
elsif version =~ /Chef: #{chef_version}$/
|
56
|
+
Chef::Log.debug "Already installed chef version #{version}"
|
57
|
+
return
|
58
|
+
elsif version.include?(chef_version)
|
59
|
+
Chef::Log.warn "Installed chef version #{version} contains desired version #{chef_version}. " +
|
60
|
+
"If you see this message on consecutive chef runs tighten your desired version constraint to prevent " +
|
61
|
+
"multiple convergence."
|
62
|
+
end
|
48
63
|
end
|
64
|
+
|
65
|
+
# Install chef client
|
66
|
+
# TODO ssh verification of install.sh before running arbtrary code would be nice?
|
67
|
+
@@install_sh_cache[install_sh_url] ||= Net::HTTP.get(URI(install_sh_url))
|
68
|
+
machine.write_file(action_handler, install_sh_path, @@install_sh_cache[install_sh_url], :ensure_dir => true)
|
69
|
+
# TODO handle bad version case better
|
70
|
+
machine.execute(action_handler, install_sh_command_line)
|
49
71
|
end
|
50
72
|
|
51
73
|
def converge(action_handler, machine)
|
@@ -59,7 +59,7 @@ module Provisioning
|
|
59
59
|
|
60
60
|
#
|
61
61
|
# A URL representing the driver and the place where machines come from.
|
62
|
-
# This will be stuffed in machine_spec.
|
62
|
+
# This will be stuffed in machine_spec.reference['driver_url'] so that the
|
63
63
|
# machine can be re-inflated. URLs must have a unique scheme identifying the
|
64
64
|
# driver class, and enough information to identify the place where created
|
65
65
|
# machines can be found. For AWS, this is the account number; for lxc and
|
@@ -94,7 +94,7 @@ module Provisioning
|
|
94
94
|
|
95
95
|
# Allocate a machine from the underlying service. This method
|
96
96
|
# does not need to wait for the machine to boot or have an IP, but it must
|
97
|
-
# store enough information in machine_spec.
|
97
|
+
# store enough information in machine_spec.reference to find the machine
|
98
98
|
# later in ready_machine.
|
99
99
|
#
|
100
100
|
# If a machine is powered off or otherwise unusable, this method may start
|
@@ -102,11 +102,11 @@ module Provisioning
|
|
102
102
|
# gears moving, but the job doesn't need to be done :)
|
103
103
|
#
|
104
104
|
# @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method
|
105
|
-
# @param [Chef::Provisioning::
|
105
|
+
# @param [Chef::Provisioning::ManagedEntry] machine_spec A machine specification representing this machine.
|
106
106
|
# @param [Hash] machine_options A set of options representing the desired options when
|
107
107
|
# constructing the machine
|
108
108
|
#
|
109
|
-
# @return [Chef::Provisioning::
|
109
|
+
# @return [Chef::Provisioning::ManagedEntry] Modifies the passed-in machine_spec. Anything in here will be saved
|
110
110
|
# back after allocate_machine completes.
|
111
111
|
#
|
112
112
|
def allocate_machine(action_handler, machine_spec, machine_options)
|
@@ -121,7 +121,7 @@ module Provisioning
|
|
121
121
|
#
|
122
122
|
#
|
123
123
|
# @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method
|
124
|
-
# @param [Chef::Provisioning::
|
124
|
+
# @param [Chef::Provisioning::ManagedEntry] machine_spec A machine specification representing this machine.
|
125
125
|
# @param [Hash] machine_options A set of options representing the desired state of the machine
|
126
126
|
#
|
127
127
|
# @return [Machine] A machine object pointing at the machine, allowing useful actions like setup,
|
@@ -134,7 +134,7 @@ module Provisioning
|
|
134
134
|
# Connect to a machine without allocating or readying it. This method will
|
135
135
|
# NOT make any changes to anything, or attempt to wait.
|
136
136
|
#
|
137
|
-
# @param [Chef::Provisioning::
|
137
|
+
# @param [Chef::Provisioning::ManagedEntry] machine_spec ManagedEntry representing this machine.
|
138
138
|
# @param [Hash] machine_options
|
139
139
|
# @return [Machine] A machine object pointing at the machine, allowing useful actions like setup,
|
140
140
|
# converge, execute, file and directory.
|
@@ -148,7 +148,7 @@ module Provisioning
|
|
148
148
|
# returning things to the state before allocate_machine was called.
|
149
149
|
#
|
150
150
|
# @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method
|
151
|
-
# @param [Chef::Provisioning::
|
151
|
+
# @param [Chef::Provisioning::ManagedEntry] machine_spec A machine specification representing this machine.
|
152
152
|
# @param [Hash] machine_options A set of options representing the desired state of the machine
|
153
153
|
def destroy_machine(action_handler, machine_spec, machine_options)
|
154
154
|
raise "#{self.class} does not implement destroy_machine"
|
@@ -157,7 +157,7 @@ module Provisioning
|
|
157
157
|
# Stop the given machine.
|
158
158
|
#
|
159
159
|
# @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method
|
160
|
-
# @param [Chef::Provisioning::
|
160
|
+
# @param [Chef::Provisioning::ManagedEntry] machine_spec A machine specification representing this machine.
|
161
161
|
# @param [Hash] machine_options A set of options representing the desired state of the machine
|
162
162
|
def stop_machine(action_handler, machine_spec, machine_options)
|
163
163
|
raise "#{self.class} does not implement stop_machine"
|
@@ -166,17 +166,19 @@ module Provisioning
|
|
166
166
|
# Allocate an image. Returns quickly with an ID that tracks the image.
|
167
167
|
#
|
168
168
|
# @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method
|
169
|
-
# @param [Chef::Provisioning::
|
170
|
-
# @param [Hash] image_options A set of options representing the desired state of the
|
171
|
-
|
169
|
+
# @param [Chef::Provisioning::ManagedEntry] image_spec An image specification representing this image.
|
170
|
+
# @param [Hash] image_options A set of options representing the desired state of the image
|
171
|
+
# @param [Chef::Provisioning::ManagedEntry] machine_spec A machine specification representing this machine.
|
172
|
+
# @param [Hash] machine_options A set of options representing the desired state of the machine used to create the image
|
173
|
+
def allocate_image(action_handler, image_spec, image_options, machine_spec, machine_options)
|
172
174
|
raise "#{self.class} does not implement create_image"
|
173
175
|
end
|
174
176
|
|
175
177
|
# Ready an image, waiting till the point where it is ready to be used.
|
176
178
|
#
|
177
179
|
# @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method
|
178
|
-
# @param [Chef::Provisioning::
|
179
|
-
# @param [Hash] image_options A set of options representing the desired state of the
|
180
|
+
# @param [Chef::Provisioning::ManagedEntry] image_spec An image specification representing this image.
|
181
|
+
# @param [Hash] image_options A set of options representing the desired state of the image
|
180
182
|
def ready_image(action_handler, image_spec, image_options)
|
181
183
|
raise "#{self.class} does not implement ready_image"
|
182
184
|
end
|
@@ -184,9 +186,10 @@ module Provisioning
|
|
184
186
|
# Destroy an image using this service.
|
185
187
|
#
|
186
188
|
# @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method
|
187
|
-
# @param [Chef::Provisioning::
|
188
|
-
# @param [Hash] image_options A set of options representing the desired state of the
|
189
|
-
|
189
|
+
# @param [Chef::Provisioning::ManagedEntry] image_spec An image specification representing this image.
|
190
|
+
# @param [Hash] image_options A set of options representing the desired state of the image
|
191
|
+
# @param [Hash] machine_options A set of options representing the desired state of the machine used to create the image
|
192
|
+
def destroy_image(action_handler, image_spec, image_options, machine_options)
|
190
193
|
raise "#{self.class} does not implement destroy_image"
|
191
194
|
end
|
192
195
|
|
@@ -267,18 +270,22 @@ module Provisioning
|
|
267
270
|
end
|
268
271
|
|
269
272
|
# Allocate a load balancer
|
270
|
-
# @param [
|
271
|
-
# @param [
|
273
|
+
# @param [Chef::Provisioning::ActionHandler] action_handler The action handler
|
274
|
+
# @param [Chef::Provisioning::ManagedEntry] lb_spec Frozen LB specification
|
272
275
|
# @param [Hash] lb_options A hash of options to pass the LB
|
273
276
|
# @param [Array[ChefMetal::MachineSpec]] machine_specs An array of machine specs
|
274
|
-
# the load balancer should have
|
277
|
+
# the load balancer should have. `nil` indicates "leave the set of machines
|
278
|
+
# alone," or for new LBs, it means "no machines."
|
275
279
|
def allocate_load_balancer(action_handler, lb_spec, lb_options, machine_specs)
|
276
280
|
end
|
277
281
|
|
278
282
|
# Make the load balancer ready
|
279
|
-
# @param [
|
280
|
-
# @param [
|
283
|
+
# @param [Chef::Provisioning::ActionHandler] action_handler The action handler
|
284
|
+
# @param [Chef::Provisioning::ManagedEntry] lb_spec Frozen LB specification
|
281
285
|
# @param [Hash] lb_options A hash of options to pass the LB
|
286
|
+
# @param [Array[ChefMetal::MachineSpec]] machine_specs An array of machine specs
|
287
|
+
# the load balancer should have. `nil` indicates "leave the set of machines
|
288
|
+
# alone," or for new LBs, it means "no machines."
|
282
289
|
def ready_load_balancer(action_handler, lb_spec, lb_options, machine_specs)
|
283
290
|
end
|
284
291
|
|