- From: Simon Detheridge <
>
- To:
- Subject: [chef] Re: Writing a cross-platform template definition
- Date: Fri, 14 Nov 2014 15:03:12 +0000 (GMT)
Thanks!
It's actually a simple cookbook that puts a bunch of files somewhere, and
writes out a config file telling an already-installed service (in a conf.d)
where they are, so it felt like it should be easy enough to accomplish. I can
see that this is something of an edge case and simple to workaround so
devoting significant time to fixing it would be counterproductive. -- I just
wondered if there were a Proper Way to do this.
The slideshare link was very informative. Cheers.
----- Original Message -----
>
Hi Simon!
>
>
Cross-platform patterns are Hard, and usually devolve into spaghetti.
>
>
I always preach maximizing for grokability, as your code will often be
>
read by other people for the first time in operations scenarios.
>
>
Usually, its more than just the individual resource that differ from
>
platform to platform, but the pattern as a whole.
>
>
If your cookbook is a language runtime, using include_recipe,
>
switching on platform may be appropriate.
>
>
If your cookbook is setting up a service, I'd suggest making a
>
resource for it, and encapsulating the code into different providers.
>
>
http://www.slideshare.net/someara/cookbook-reusability-chef-community-summit-2014
>
>
github.com/opscode-cookbooks/mysql
>
github.com/opscode-cookbooks/httpd
>
>
-s
>
>
On Fri, Nov 14, 2014 at 12:51 PM, Simon Detheridge
>
<
>
>
wrote:
>
> Hi,
>
>
>
> I'm trying to write a recipe that works on Linux and Windows.
>
>
>
> If I write:
>
> user "root"
>
> in a template, Windows throws an error declaring "No mapping between
>
> account names and security IDs was done."
>
>
>
> The docs suggest that I should be using 'rights' instead of 'user', but
>
> this means I'd have to write all of my templates or recipes twice. Is
>
> there a workaround? (Can I map 'root' to 'Administrator'?)
>
>
>
> I can set a 'root_user' attribute on my nodes, but this makes the cookbook
>
> non-usable outside of my environment. Is there an accepted way to
>
> accomplish this?
>
>
>
> --
>
> Simon Detheridge - CTO, Widgit Software
>
> 26 Queen Street, Cubbington, CV32 7NA - Tel: +44 (0)1926 333680
>
--
Simon Detheridge - CTO, Widgit Software
26 Queen Street, Cubbington, CV32 7NA - Tel: +44 (0)1926 333680
Archive powered by MHonArc 2.6.16.