ol muser
asked on
check exit code in chef-solo script
Hi Experts,
I have a command line program TEST.EXE that gives status code on exit (internally C# program using Environment.Exit).
I have downloaded chef client for windows and I have also created a test cook book using the following command.
Knife cookbook create testcookbook
Following an online tutorial I am able to create a text file by altering the contents of recipies\default.rb.
Now, all I need is to be able to run this program TEST.EXE, and show that it is returning an exit code, all inside the recipies\default.rb file.
So at the end, I should be able to run the chef-solo command and it should run the recipe and show some indication of what the exit code was. Perhaps an output message based on the exit code.
Could someone show me a script that can do this?
If you are giving tips please assume zero experience with Chef/Ruby.
If it matters, my environment is Windows 2008 server
Thanks!
I have a command line program TEST.EXE that gives status code on exit (internally C# program using Environment.Exit).
I have downloaded chef client for windows and I have also created a test cook book using the following command.
Knife cookbook create testcookbook
Following an online tutorial I am able to create a text file by altering the contents of recipies\default.rb.
Now, all I need is to be able to run this program TEST.EXE, and show that it is returning an exit code, all inside the recipies\default.rb file.
So at the end, I should be able to run the chef-solo command and it should run the recipe and show some indication of what the exit code was. Perhaps an output message based on the exit code.
Could someone show me a script that can do this?
If you are giving tips please assume zero experience with Chef/Ruby.
If it matters, my environment is Windows 2008 server
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.