- From: AJ Christensen <
>
- To: "
" <
>
- Subject: [chef] Re: Re: LWRP, append text to file only if it doesnt comtain it
- Date: Wed, 11 Mar 2015 07:48:49 +1300
That Chef::Util::FileEdit code is very antiquated (and bound to Chef
Core releases for bug-fixes) and probably makes up some if not most of
the logic encapsulated by Sean's line cookbook, although it is plain
to see that it does not re-use the Chef::Util code (IMO, the right
choice.)
I'd recommend the latter. Use whatever works for you.
cheers,
--aj
On Wed, Mar 11, 2015 at 7:37 AM, Yonah Russ
<
>
wrote:
>
Hi,
>
I have used Chef::Util::FileEdit for things like this in the past.
>
Docs are here:
>
http://www.rubydoc.info/gems/chef/Chef/Util/FileEdit#insert_line_if_no_match-instance_method
>
>
If it works, is there a reason not to do it this way?
>
Thanks,
>
Yonah
>
>
>
On Tue, Mar 10, 2015 at 7:18 PM, Medya
>
<
>
>
wrote:
>
>
>
> is there any LWRP way to do append a text to a file if it does NOT contain
>
> it ?
>
>
>
> for exmaple
>
>
>
> add PEERDNS=no to this file
>
> /etc/sysconfig/network-scripts/ifcfg-eth0
>
>
>
> only if it is not there
>
>
Archive powered by MHonArc 2.6.16.