- From: "John E. Vincent (lusis)" <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: Re: Re: Re: where is the better place for this code?
- Date: Thu, 17 Nov 2011 12:41:45 -0500
2011/11/17 Juan Jesús Ojeda Croissier
<
>:
<snip>
>
> Chef already has code for this:
>
> https://github.com/opscode/chef/blob/master/chef/lib/chef/util/file_edit.rb
>
>
>
> That said, you really should do whatever you can to avoid using
>
> search/replace.
>
>
>
>
Hummm... I'm curious... why's that?
>
>
BTW, thanks for the link :-)
>
>
--
>
Juanje
>
The proper path is to manage the file with Chef (as a template) or
move the setting/line it needs somewhere that Chef can manage.
Search and replace is fragile.
Depending on the type of file, you can:
- substitute an environment variable sourced from a file that Chef DOES
manage.
- include another file that chef manages at the head of the file that
needs the setting
- merge the contents of that file with another file that chef manages
as part of the recipe
- move the setting out of that file into some sort of configuration repository
- [chef] where is the better place for this code?, Juan Jesús Ojeda Croissier, 11/15/2011
- [chef] Re: where is the better place for this code?, hani elabed, 11/15/2011
- [chef] Re: where is the better place for this code?, Andrea Campi, 11/16/2011
- [chef] Re: Re: where is the better place for this code?, Juan Jesús Ojeda Croissier, 11/16/2011
- [chef] Re: Re: Re: where is the better place for this code?, Andrea Campi, 11/16/2011
- [chef] Re: Re: Re: Re: where is the better place for this code?, Juan Jesús Ojeda Croissier, 11/16/2011
- [chef] Re: Re: Re: Re: Re: where is the better place for this code?, Andrea Campi, 11/16/2011
- [chef] Re: Re: Re: Re: Re: Re: where is the better place for this code?, Daniel DeLeo, 11/17/2011
- [chef] Re: Re: Re: Re: Re: Re: Re: where is the better place for this code?, Juan Jesús Ojeda Croissier, 11/17/2011
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: where is the better place for this code?, John E. Vincent (lusis), 11/17/2011
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: where is the better place for this code?, Juan Jesús Ojeda Croissier, 11/17/2011
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: where is the better place for this code?, Matthew Moretti, 11/17/2011
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: where is the better place for this code?, Juan Jesús Ojeda Croissier, 11/17/2011
- [chef] Re: Re: Re: Re: Re: Re: Re: where is the better place for this code?, Andrea Campi, 11/17/2011
Archive powered by MHonArc 2.6.16.