Skip to content

Instantly share code, notes, and snippets.

@danielsdeleo
Created May 1, 2013 02:00
Show Gist options
  • Select an option

  • Save danielsdeleo/5493303 to your computer and use it in GitHub Desktop.

Select an option

Save danielsdeleo/5493303 to your computer and use it in GitHub Desktop.
Deps in Chef 11 Solo

Deps in Chef Solo

I totally agree that the change from metadata dependencies being optional on solo to required in Chef 11 is not an optimal experience. But it's also true that the new behavior is beneficial for everyone. This issue was painful enough that it's been raised over and over again on the ticket tracker:

The original solution, include_attribute was a hack, at best. Even at Opscode, we had chef runs fail because we missed a dependency and didn't use include_attribute where we should have. And this problem affected chef-client and chef-solo users equally.

How to fix it?

So we're not going to go back and reintroduce that bug in chef-solo. But I would very much like to improve the error message when you miss a dependency. It's not as easy as it looks though:

Idea 1: Warn when there are unused cookbooks

We could add a warning whenever chef-solo is run with "extra" cookbooks that don't appear in the run_list or dependency graph. But, assuming a fair number of chef-solo users distribute all of their cookbooks to their nodes and run customized run lists, this is going to generate a lot of warnings in a lot of cases where everything is ok. So it's really not a solution.

Idea 2: Include a list of "extra" cookbooks in error messages

This is a little bit better than the first one, because you only see it when there's an error, but without a good way to tell whether or not an error is caused by a missing dependency, you just end up with a slightly less bad version of option 1.

Idea 3: Load "extra" Cookbooks

This seems okay, but without a way to determine in what order the "extra" cookbooks need to be loaded, might we reintroduce errors where cookbooks load in an incorrect order and be back where we started?

Conclusion

So, it's not true that no one at Opscode cares about solo. In fact, we got bitten by these same issues in the cookbooks we use in the omnibus server packages. The new behavior fixes a pretty serious issue that affects client and solo alike, it's not an intentional slight to solo users. If we can figure out a way to improve the error messages for missing cookbook deps in chef-solo, we'll definitely do it.

@rmoriz
Copy link
Copy Markdown

rmoriz commented May 1, 2013

👍

The problem is imho not because of the reason for the change, which is a good thing, but about the lack of communication.

The breaking change that affects pretty much every chef-solo user is hidden inside this long page http://wiki.opscode.com/display/chef/Breaking+Changes+in+Chef+11 and there is no example provided…

@danielsdeleo
Copy link
Copy Markdown
Author

I'll work with our docs guy to add some examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment