Hi, I would like to use the file resource type to place files in users home directories via puppet. This doesn''t work on systems where home directories are provided via nfs and root_squash is enabled on the nfs server. Is there a way to work around this in puppet, similar to how the exec resource type can specify what user it will run as? All the best, Brian Pitts -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Adam Gray
2010-Mar-30 16:51 UTC
Re: [Puppet Users] Using puppet on nfs mounts with root squashed
Since the puppet clients are running as local root, they would need to drop privileges to a uid with access to the NFS mount in order to source the files. You could make an exec {} to look and feel like a file {}, but it would really have to copy files from NFS somewhere local (/tmp?) then move from there to the final destination. This is completely untested and uneducated, but here''s an attempt (I don''t even know if you can require exec''s): define nfsfile($type = file, $mode = 644, $owner = root, $group = root) { exec { copiescopiescopies: command => "sudo -u nfsperson cp /path/to/nfs/$name /tmp/puppettemp" } file { $name: require => Exec[copiescopiescopies], source => "/tmp/puppettemp", mode => $mode, owner => $owner, group => $group, } } -adam On Sat, Mar 27, 2010 at 10:29, Brian <bdp@uga.edu> wrote:> Hi, > > I would like to use the file resource type to place files in users > home directories via puppet. This doesn''t work on systems where home > directories are provided via nfs and root_squash is enabled on the nfs > server. Is there a way to work around this in puppet, similar to how > the exec resource type can specify what user it will run as? > > All the best, > Brian Pitts > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.