Reputation: 1046
I wrote a short bash script and stored it in files/default/bash.sh
.
How do I link it to get it to run in my main default recipe? It needs to run as sudo because I'm on an ubuntu system.
Upvotes: 13
Views: 17711
Reputation: 54267
You can also include the script directly in your recipe if it isn't too long via the bash
resource. By default any program run by Chef uses the same user as Chef is running as, which is usually root already. You can use the user
parameter to things like execute
and bash
to switch to a different user or just explicitly state that it should be root to make things self-documenting a tad.
Upvotes: 3