You can also include the script directly in your recipe if it is not too long using a bash resource . By default, any program executed by Chef uses the same user as Chef, as a rule, it is already root. You can use the user parameter for things like execute and bash to switch to another user or simply explicitly indicate that it must be root in order to make things self-documenting.
source share