the resource_directory
has only 2 actions available: create
and delete
I need to update the owner and group of a directory recursi
If this as a one-off to fix permissions your shortest path might be just knife ssh. (I just did that after ending up here on my own search.)
knife ssh 'name:*' "sudo chown -R $user:$group /full/path/to/directory"
knife ssh 'name:*' "sudo chmod -R 770 /full/path/to/directory"
If I were setting this up from scratch I think I'd need to set up the directory path and proper permissions with one line (NOTE: explicitly apply the perms to each parent in the path)
%w[ /foo /foo/bar /foo/bar/baz ].each do |path|
directory path do
owner 'root'
group 'root'
mode '0755'
end
and then create each individual file as a cookbook_file.