-
Notifications
You must be signed in to change notification settings - Fork 213
Conversation
With this PR chef-solo-search is obsolete! |
Sweet. A couple questions though:
|
Search works fine for me. I do a lot of stuff like
I have now idea how to write an integration test :/ Switching to chef-client -z makes sense, but this would result in a different command for chef >= 11 and chef < 11. |
We already check the chef version to determine dependencies, so I don't think switching commands would be that bad. Though maybe it's still early to worry about it. Not sure when Chef is planning on deprecating the chef-solo command itself. |
Can you look into this? |
I guess the best solution would to use chef-solo for chef < 11 and chef-client -z --force-formatter for Chef 11 and newer. Ok this is my current solution:
If you use chef-client instead of chef-solo you get warnings like this:
|
I'm not sure if chef-zero works as expected. AFAIK it is incompatible wich chef-solo-search and will crash chef-zero (chef-solo local mode) converges, at least this is what I'm run into when using test-kitchen with chef-zero if a cookbook dependency injects chef-solo-search (which knife-solo afaik does by default when uploading the cookbooks). |
If you provide some basic steps to test it (how/what files to change) then i can test tomorrow if search is working as expected. |
If nothing else, chef zero requires that roles & environment files be json rather than ruby. That's something I'd like to get ironed out (e.g., have a pre-processing step that does the conversion) before supporting local mode from knife-solo. We also need to add logic to remove the search cookbook when running local mode. |
Oh, and there's the question of what to do about node writes. When running in local mode do we want to copy the resulting node files back to the client? If not people might be surprised when their node attributes are not saved for subsequent runs. |
@matschaffer wrting results back sounds like a good idea. If you publish the feature without that function I want not complain either. I would really like to see local mode included soon because we monkey patch knife-solo right now which is not very user friendly. We have a lot of cookbooks who look like this:
They work just fine, we do not see any crashes maybe because we do not include chef-solo-search. |
knife-zero for example writes back all node attributes which is nice but also some kind of over-verbose (all ohai attributes…lots of changes on each converge ) |
@florian-asche just create a blank cookbook with a dependency to 'chef-solo-search' in its metadata. then try to converge it using chef-zero (e.g. using test-kitchen). Due to the file structure of chef-solo-search the "upload" to the in-memory chef-server will fail (or some parts of the cookbook will be missing). |
@rmoriz ouch. Perhaps the initial implementation shouldn't worry about getting node data back to the client then. Wonder if there's something we could do to at least ensure the file on the host doesn't get clobbered so it can be used on the next run. |
@matschaffer chef-client can white-list/black-list attributes it sends back to chef-server (chef-zero). For example: |
any news here? |
Not really. I can't merge as is since I pretty sure it'll break anyone not already using json roles & environments, potentially other issues too. I'm all for chef zero but it'll have to be a more concerted effort. |
PR for #353