Your link is for posting a new message to this group on Google Groups. Perhaps you wanted this: http://www.puppetcookbook.com/posts/remove-duplicated-file-resource-attributes.html
You say you want to check file permission/ownership. Do you want to make any changes if things are not how you want them ? Subtle, but different. Any file managed by Puppet can be controlled. However, Puppet does not (directly) do anything to any file it does not manage. The above cookbook-example will not set permission/ownership to any file not explicitly managed. Do you plan to manage all these files in Puppet ? If not, another approach is needed. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) ----- Original Message ----- From: "root" <[email protected]> To: [email protected] Sent: Friday, August 2, 2013 2:29:27 PM Subject: [Puppet Users] crapload of files to check permissions and ownership Very new to Puppet and I need to create a class that checks the file permissions and ownership for 60- 100 files. Some of the files will be named differenty or have a different path depending on the OS. I am aware of the core_permissions class demonstrated in the Puppet 3.0 Quick Start, and I have read "Reduce Duplicated File Attributes" here: https://groups.google.com/forum/?hl=en#!newtopic/puppet-users That document advocates setting a default set of attributes for the File resource, and then nest all the declarations inside one resource statement, like so: File { ensure => "present", owner => "root", group => "root", mode => 644, } file { "/etc/cobbler/modules.conf": content => template("cobbler/modules.conf"); "/etc/cobbler/dhcp.template": content => template("cobbler/dhcp.template"); # override the permissions for this one file "/etc/cobbler/users.digest": source => "puppet:///modules/cobbler/users.digest.live", mode => 660; } This looks kind of ugly to me. Anyone figure out a nicer way to do this? I will only be checking "ensure", "mode", "owner" and "group". I want the class to be readable to admins who are new to Puppet, but I don't want to have a separate "file" declaration for each file. Thanks. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-users . For more options, visit https://groups.google.com/groups/opt_out . -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
