I have to run a custom chef recipe for creating a directory under /ops, but I do not want to use root user for this. I have a user who has the sudo priviliges to create a directory manually
sudo mkdir /ops/usr/apps is working fine manually.
I have my recipe to create a directory as this:
directory "#{node[:workspace]}" do
owner "#{node[:user]}"
mode "0775"
recursive true
action :create
end
Can I simulate something similar to above manual command using sudo for my current user. Thanks in advance for the help.
Why don't you just run chef solo using sudo?