There is currently only one workaround to this, which is to use exec{}
statements to distribute and set the file attributes. Unfortunately puppet
is incredibly slow at this type of operation!
On Fri, Jul 4, 2008 at 9:43 AM, Brice Figureau <
brice-puppet@daysofwonder.com> wrote:
>
> Hi,
>
> I''m using the following manifest snippets to distribute some files
to
> home folders of my users:
>
> file {
> "${homeroot}/$name":
> source => [ "puppet:///files/users/$name/skel/",
> "puppet:///files/users/skel/"],
> sourceselect => all,
> checksum => mtime,
> recurse => true, owner => $name, group => $name,
> require => [ User["$name"], Group["$name"] ];
> }
>
> This is part of a larger define that manages users and groups.
>
> Unfortunately if the home directory of the user contains lots of files
> and deep hierarchy, puppetd seems to pass a looong time to scan/stat all
> the files present there (and not only the ones referenced by the
> source).
>
> Here is one of the debug log entry to show the issue (this is the above
> file resource but with force - without force, no debug lines are printed
> while stating):
> debug: //all_users/Account[brice]/File[/home/brice/.gnupg]/checksum:
> Initializing checksum hash
> debug: //all_users/Account[brice]/File[/home/brice/.gnupg]: Creating
> checksum {mtime}Sat May 10 00:03:00 +0200 2008
>
> Why not first ask to the puppetmaster the list of files that should be
> present (it can infer it from the source), and then only stat their
> matching counterpart locally?
>
> The second issue is that each file referenced in the aforementioned
> source is _always_ copied from the puppetmaster to puppet even if it
> didn''t change because the file checksum (md5) is compared to the
file
> mtime.
>
> debug: Calling fileserver.list
> debug: Calling fileserver.describe
> debug: Calling fileserver.retrieve
> debug: //all_users/Account[brice]/File[/home/brice/.zshrc]/source:
> Executing ''diff -u /home/brice/.zshrc
> /tmp/user/0/puppet-diffing20080704-15708-glfegc-0''
> debug: //all_users/Account[brice]/File[/home/brice/.zshrc]: Changing
> checksum,source
> debug: //all_users/Account[brice]/File[/home/brice/.zshrc]: 2 change(s)
> debug: //all_users/Account[brice]/File[/home/brice/.zshrc]/checksum:
> Replacing /home/brice/.zshrc checksum {md5}1395a1f669e2c86443b142cc5ad10f55
> with {mtime}Fri Jul 04 15:17:39 +0200 2008
> notice: //all_users/Account[brice]/File[/home/brice/.zshrc]/checksum:
> checksum changed ''{md5}1395a1f669e2c86443b142cc5ad10f55''
to ''{mtime}Fri Jul
> 04 15:17:39 +0200 2008''
> debug: Calling puppetbucket.addfile
> info: //all_users/Account[brice]/File[/home/brice/.zshrc]: Filebucketed to
> server with sum 1395a1f669e2c86443b142cc5ad10f55
> debug: //all_users/Account[brice]/File[/home/brice/.zshrc]/checksum:
> Replacing /home/brice/.zshrc checksum {mtime}Fri Jul 04 15:17:39 +0200 2008
> with {md5}1395a1f669e2c86443b142cc5ad10f55
> notice: //all_users/Account[brice]/File[/home/brice/.zshrc]/source:
> replacing from source puppet:///files/users/brice/skel/.zshrc with contents
> {md5}1395a1f669e2c86443b142cc5ad10f55
>
> The third issue is the memory puppetd is using (taken during a run with
> some huge home folders).
> root 12829 86.8 45.9 1942556 1866788 pts/0 Rl+ 14:36 15:36 ruby
> /usr/sbin/puppetd --test --verbose --debug --trace
> I think that storing all hashes of all those non-managed files consume a
> large memory.
>
> I understand that those issues can be design limitations of the way the
> file {} resource is working in recursive mode.
>
> Is there any workaround to achieve what I want?
> If I want to fix this, where should I look in the code?
>
> Thanks,
> --
> Brice Figureau <brice-puppet@daysofwonder.com>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---