how to chmod files within directory . . . .

172 views
Skip to first unread message

Chris Tomlin

unread,
Jul 4, 2016, 5:07:25 PM7/4/16
to Puppet Users
. . . . . with one type of permissions and within that same directory, chmod subdirectories with different permissions.

I've tried to do this with find -type exec {} but it doesn't seem to work.  And I'm new to puppet so if you could show some code, i'd appreciate it.

thanks,
Chris

jcbollinger

unread,
Jul 5, 2016, 9:04:56 AM7/5/16
to Puppet Users


On Monday, July 4, 2016 at 4:07:25 PM UTC-5, Chris Tomlin wrote:
. . . . . with one type of permissions and within that same directory, chmod subdirectories with different permissions.

I've tried to do this with find -type exec {} but it doesn't seem to work.  And I'm new to puppet so if you could show some code, i'd appreciate it.



Perhaps you could be a little more specific about what you want to do, especially if you want code.  Until then, here are some guidelines:
  • Do not manage the same physical resource via multiple Puppet resources.  In particular, make sure there are no files that are managed via both a File and an Exec.
  • Puppet knows that on Unix systems, directories modes need execute bits to accompany read bits; it handles this for you to simplify recursive directory management.
  • File resources in general, and recursive ones in particular, work best for relatively small total numbers of files not-huge files.
  • Except with respect to (sub)directory execute permissions, if you want to manage different files to have different permissions (/ ownership / security context) then you need to use separate File resources or an altogether different resource type.
  • If you have a large or complex set of related files to manage, and especially if none of them are expected to change frequently, then don't overlook the possibility of packaging them up and managing them together via a Package resource.
John

Reply all
Reply to author
Forward
0 new messages