chef-boneyard / chef-provisioning

A library for creating machines and infrastructures idempotently in Chef.
Apache License 2.0
524 stars 164 forks source link

Add resource lookup to chef-provisioning core resources #360

Open tyler-ball opened 9 years ago

tyler-ball commented 9 years ago

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:

  1. All the implementation details for each driver live in the driver.rb files - this is different than all other chef resources and causes confusion
  2. 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.

tyler-ball commented 9 years ago

TODO - add a 2.0 milestone to this