I have a working jar file on a ubuntu virtual machine. I need to create a Chef recipe to:
Could it be achieved by CHEF?
Regards, Aditya Chaudhary
There are lots of options out there. The simplest is probably:
execute "run file.jar in directory" do
command "java -jar file.jar"
cwd "directory containing jar file"
action :run
end
The jar command will return an error code that Chef will use to determine success or failure. There are many ways to do this with Chef. You can see how others recommended running the jar command in the backround here if you need to move on after this command: Jar execution in background
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With