- From: Jesse Campbell <
>
- To:
- Cc: Bryan McLellan <
>,
- Subject: [chef] Re: Re: Identifying if a node is being bootstrapped
- Date: Fri, 9 Mar 2012 14:08:20 -0500
Bryan I like your method of either making the various tasks
idempotent, or to just put them all in an unless File.exists block...
maybe even use /etc/chef/.<cookbook>[-<recipe>].bootstrapped so
they're all in the same place.
I used to need to manage the network and hostname fields, but for now
I have knife vsphere handling that... but if I run into something else
that's only a run-once, and idempotent is hard, I'll use this method.
Thanks!
On Fri, Mar 9, 2012 at 13:41, John E. Vincent (lusis)
<
>
wrote:
>
On Fri, Mar 9, 2012 at 12:55 PM, Bryan McLellan
>
<
>
>
wrote:
>
> On Fri, Mar 9, 2012 at 1:04 AM, John E. Vincent (lusis)
>
> <
>
>
> wrote:
>
>> Came across a situation tonight that I wanted to get feedback on. I've
>
>> got some standard patterns I use for dealing with TRUE one-time run
>
>> recipes.
>
>>
>
>> Thoughts?
>
>
>
> Maybe you are making this too complicated and hard on yourself?
>
>
>
> Why is the work done by the resources in the recipe not idempotent?
>
> If that is complicated, why not wrap the whole recipe in a wrapper
>
> that prevents it from happening again?
>
>
>
> unless File.exists('/opt/app/.done')
>
> # do stuff
>
>
>
> # done with stuff
>
> file "/opt/app/.done"
>
> end
>
>
>
> If you do a lot of on every system, maybe a 'bootstrap' role that is
>
> in the beginning of a run list for all nodes that contains the
>
> bootstrap recipes?
>
>
>
> Bryan
Archive powered by MHonArc 2.6.16.