There is a way to change a sudo group using a resource group:
group "create testuser sudo" do
group_name 'sudo'
members 'testuser'
action :modify
append true
end
Another way is to use the sudo recipe https://supermarket.chef.io/cookbooks/sudo .
The recommended way for me is to go to the sudo recipe and the unload system logic for the recipe. There you get resource configuration attributes that make your recipe code reliable.
source
share