devstructure / blueprint

Reverse engineer server configuration
http://devstructure.com/
Other
2.15k stars 132 forks source link

Resources of type 'link' are included in services as 'cookbook_file' resources, halting Chef #116

Closed abrookins closed 12 years ago

abrookins commented 12 years ago

I'm using blueprint 3.4.1-1py2.6 to create a cookbook for Chef 0.10.18 from an Ubuntu 10.04 server to another Ubuntu 10.04 server.

The issue I have is that using blueprint show --chef {name} generates a recipe with link resources, e.g.:

link('/etc/apache2/mods-enabled/auth_digest.load') do
  group 'root'
  owner 'root'
  to '../mods-available/auth_digest.load'
end

Which are later used in a service as cookbook_file resources, e.g. (other resources removed for clarity):

service('apache2') do
  action [:enable, :start]
  subscribes :restart, resources('cookbook_file[/etc/apache2/mods-enabled/auth_digest.load]')
end

Chef dies with this output (let's assume a cookbook named 'blueprint-cookbook'):

user@server:~$ sudo chef-solo -j nodes.json 
[Mon, 27 Feb 2012 13:02:50 -0500] INFO: *** Chef 0.10.8 ***
[Mon, 27 Feb 2012 13:02:50 -0500] INFO: Setting the run_list to "blueprint-cookbook" from JSON
[Mon, 27 Feb 2012 13:02:50 -0500] INFO: Run List is [recipe[blueprint-cookbook]]
[Mon, 27 Feb 2012 13:02:50 -0500] INFO: Run List expands to [blueprint-cookbook]
[Mon, 27 Feb 2012 13:02:50 -0500] INFO: Starting Chef Run for server-name
[Mon, 27 Feb 2012 13:02:50 -0500] INFO: Running start handlers
[Mon, 27 Feb 2012 13:02:50 -0500] INFO: Start handlers complete.
[Mon, 27 Feb 2012 13:02:50 -0500] ERROR: Running exception handlers
[Mon, 27 Feb 2012 13:02:50 -0500] ERROR: Exception handlers complete
[Mon, 27 Feb 2012 13:02:50 -0500] FATAL: Stacktrace dumped to /tmp/chef-solo/cache/chef-stacktrace.out
[Mon, 27 Feb 2012 13:02:50 -0500] FATAL: Chef::Exceptions::ResourceNotFound: Cannot find a resource matching cookbook_file[/etc/apache2/mods-enabled/auth_digest.load] (did you define it first?)

This error seems to occur for all "link" resources.

rcrowley commented 12 years ago

Thanks for the report! I'm not a Chef user so this one slipped by.

abrookins commented 12 years ago

Excellent. Thanks for your time!

wizonesolutions commented 11 years ago

Is this fix contained in the version in the APT repo, or should one build from source to get it?

rcrowley commented 11 years ago

@wizonesolutions This is going to be in 3.4.2, which I'm testing and releasing now.