[chef] Re: file and contents match


Chronological Thread 
  • From: Torben Knerr < >
  • To:
  • Subject: [chef] Re: file and contents match
  • Date: Tue, 21 Aug 2012 08:35:46 +0200

Something like this?

`only_if { File.exist?("foo") && IO.read("foo") =~ /regex/ }`

Cheers,
Torben

On Tue, Aug 21, 2012 at 7:06 AM, Maven User 
< >
 wrote:
> Is there a way to check that not only does a file exist, but it contains
> several particular strings before executing a resource?
>
> I'm wondering if it's just a ruby block to read in the file, test each line,
> etc....
>



Archive powered by MHonArc 2.6.16.

§