puppetpuppet-enterprisepuppetlabs-apache

Maintain sub-folder and files permission as in source: puppet


I have configured a master- client setup for puppet. I have a complete project that I have to copy to agents. There are some scripts (executable) and some jars and some configuration files. Now When I copy copy project, all permissions are changed. I know I can user "mode" to set the permission but the problem is that it is applied to whole files i.e., all sub-folders and files in the given folder. What is the best way to maintain the all documents permission on client side as it was on source (master) side.


Solution

  • The file resource has the attribute source_permissions. So you could do something like this:

    file { '/some/where':
        ...
        source_permissions => 'use', # or 'use_when_creating'
    }