Hi all , I am new to chef and what I am trying to do is run a bash script which from chef which will return some status and based on the that status I have to run a custom_resource.
The following is code I am trying to run.
var = false
ruby_block ‘something’ do
var = shell_out(“sh my_script.sh”).status.success?
custom_resource “my_resource” do
As the value of var is checked at compile time, “if” is always false, is there a way to retain value of var outside ruby block or any other way to get status from shell script and call custom_resource at compile time.
I have also tried
notify inside ruby_block, but it also gives error because of custom_resource.