When to use shellout?

2.1k Views Asked by At

When is it appropriate to use shellout in a recipe instead of bash blocks or execute? I'm inclining to using it by default for all outside calls, because of its logging, but the verbosity of the command are a disadvantage.

1

There are 1 best solutions below

0
On BEST ANSWER

Use Shellout

When you need to get the result of the command to use elsewhere

Use script and children

When you want Chef to execute the code for you.

Shellout is not a replacement to script/execute blocks. They also execute at different times during the Chef Client run. Shellout is a Ruby thing, whereas script/execute are Chef resources like template. There is a lot of safety and cross-platform support wrapped in these resources that you won't get with Shellout.