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.


Reply via email to