Execute resource will give u the stdout & stderr of your script in case it breaks, i.e. returns non zero values. It is the responsibility of your power shell script to do the error checking and return a non zero value in case bad things happen. You can run the chef client in debug mode (-l debug) and see if that shows the output. Another option will be to use mixlib/shellout to execute the command inside a ruby_block resource , then you can explicitly print the command.stdout using Chef::Log.info
Hi,
Thanks for that pointer.
Is there a way to pipe the output of the script back into chef? I am running a powershell script and get a “successfully run” message although it clearly has not run
Cheers,
florian
From: Ranjib Dey [mailto: " target="_blank"> ]
Sent: 12 July 2013 16:04
To: " target="_blank">
Subject: [chef] Re: execute a scripts included in the cookbook
yes you can, you can use the cookbook_file to dirstribute/install the script in a location (say /usr/local/foo) and use the execute resource to invoke it (execute "/usr/local/foo"),
On Fri, Jul 12, 2013 at 6:52 AM, Florian Hehlen < " target="_blank"> > wrote:
HI,
I would like to include a native script and execute it from a recipe rather than in-lining it into the recipe.
Is this possiblem
Cheers,
Florian
LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word "misdirected" as the subject and delete this communication from your system.
LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word "misdirected" as the subject and delete this communication from your system.
Archive powered by MHonArc 2.6.16.