[chef] RE: How to show output of shell script on console?


Chronological Thread 
  • From: "Fitzwater, Brian K (CTR)" < >
  • To: " " < >
  • Subject: [chef] RE: How to show output of shell script on console?
  • Date: Tue, 26 May 2015 21:16:11 +0000
  • Accept-language: en-US
  • Authentication-results: spf=none (sender IP is 216.81.82.139) smtp.mailfrom=uscis.dhs.gov; lists.opscode.com; dkim=none (message not signed) header.d=none;

You could use  Mixlib::ShellOut.

 

https://github.com/chef/mixlib-shellout

 

I use Chef::Log to output to the console, for example:

 

find = Mixlib::ShellOut.new("find . -name '*.rb'")

find.run_command

Chef::Log.info “Find results: #{find.stdout}”

 

--fitz

 

 

From: Fouts, Chris [mailto:
Sent: Tuesday, May 26, 2015 4:45 PM
To:
Subject: [chef] How to show output of shell script on console?

 

I have a ruby_block that just executes a shell script. How do I get Chef to echo its output to the console? Will using a bash resource do it?

 

Chris




Archive powered by MHonArc 2.6.16.

§