Right now, typing machine in a recipe only has the possibility of returning 1 resource - an Chef::Resource::Machine object. This causes issues for lots of reasons:
All the implementation details for each driver live in the driver.rb files - this is different than all other chef resources and causes confusion
It means I can't pass any provider specific attributes to a machine resource. IE, I cannot do
machine "my_machine" do
instance_type "m1.micro"
end
I could use aws_instance instead of machine, but aws_instance does not have any implementation details - all of that still lives inside driver.rb
I propose we move all of the idempotent logic for managing resources out of driver.rb into the existing providers and instead add lookup functionality that correctly translates the machine DSL into a Chef::Resource::AwsInstace object with a Chef::Provider::AwsInstace provider.
Right now, typing
machine
in a recipe only has the possibility of returning 1 resource - anChef::Resource::Machine
object. This causes issues for lots of reasons:driver.rb
files - this is different than all other chef resources and causes confusionmachine
resource. IE, I cannot doI could use
aws_instance
instead ofmachine
, butaws_instance
does not have any implementation details - all of that still lives inside driver.rbI propose we move all of the idempotent logic for managing resources out of driver.rb into the existing providers and instead add lookup functionality that correctly translates the
machine
DSL into aChef::Resource::AwsInstace
object with aChef::Provider::AwsInstace
provider.