[chef] Re: Re: application cookbook "annoyances"


Chronological Thread 
  • From: Torben Knerr < >
  • To:
  • Subject: [chef] Re: Re: application cookbook "annoyances"
  • Date: Wed, 6 Feb 2013 12:12:54 +0100


Am 06.02.2013 03:41 schrieb "Joshua Timberman" < "> >:
>
> Ohai,
>
> On 2/5/13 7:25 AM, "Torben Knerr" < "> > wrote:
>
>
> >1) some cookbooks rely on roles, e.g. nagios::client or munin::client
> >find their server counterpart using a search for `role:monitoring`
> >
> >I'm thinking of keeping the roles as "marker roles" which act like tags
> >basically and keep backwards compatibility for cookbooks using role-based
> >searches.
> >
> >How do you handle this?
>
> One thing we've talked about in the past is having the role set as an
> attribute. The nagios cookbook currently allows this. IMO this is a great
> use case for roles anyway, and one of their purposes.
>

The nagios cookbook allows to set role to search for in the search query (default is "monitoring"), but it doesn't set the role of the node, does it?

If so, I wouldn't have to keep around marker roles as .rb files but would set the node's role in the application cookbook instead.

> An argument could be made that the search should be for a node with the
> appropriate recipe applied, but only recipes in the expanded run list (not
> those from 'include_recipe' in another recipe)...
>

Agree, but this having the problems described in 2) below...

I believe that there are valid use cases for both searches, so we'd ideally find a way to handle both.

> >2) some cookbooks search for recipes in the runlist, e.g.
> >apt::cacher-client searches for servers with `recipe:apt\:\:cacher-ng`
> >
> >Now that the only item in my run_list is `my-app-cookbook` and the
> >`apt::cacher-ng` is `include_recipe`d it can not be found anymore via
> >that search.
> >
> >How do you handle such cases?
> >
> >I believe there are a lot more recipes using these kinds of searches
> >which would break when following the application cookbook pattern.
> >
> >I could live with "marker roles" to make these cookbooks happy, but for
> >the cookbook searches I have no clue.
> >
> >Is it true that with Chef 11 `include_recipe`d recipes show up in the
> >expanded run_list? Can you search for them using
> >`recipe:apt\:\:cacher-ng` for example?
>
> They do not get appended to the "recipes" attribute. That has also been
> discussed in the past:
>
> * http://tickets.opscode.com/browse/CHEF-1977
>
>

That's currently the dealbreaker for me. I added a comment and upvoted the ticket.

In the meantime, is there any viable workaround other than patching the cookbooks that use search 'recipe:...'?

E.g. would it be possible to set the "recipes" attribute from within the application cookbook and would that be indexed for search then?

> I thought there was another ticket for this, but I couldn't find it.
>
> Cheers,
> Joshua
>
>




Archive powered by MHonArc 2.6.16.

§