Puppet 3 receiver files terribly slow

I use Puppet 3 on Amazon Linux 2012.09, one of my manifests sets up and reconfigures some directories. One of the tasks is simply to change the owner of the folder and the recursivelt group to another user - however, this takes 60 seconds and there is nothing left in the directory - chown myuser: myuser / var / lib / jenkins in the terminal takes less than a second.

My question is: is there a better / faster way to recursively change folder ownership?

thank

 file {'/var/lib/jenkins':
   ensure  => 'directory',
   owner   => myuser,
   group   => myuser,
   recurse => true,
   require => Package['jenkins'],
 }
+5
source share
1 answer

, , -, , Puppet /var/lib/jenkins , , , , $JENKINS_HOME.

Jenkins, chown -R ( exec) , :

define modify_owner() {
  exec { "modify_owner_${title}" :
    command => "/bin/chown -R ${user}:${user} '${title}'",
    onlyif => "/usr/bin/stat -c %U '${title}' | grep '^${default_user}$'"
  }
}

modify_owner { ['/var/lib/jenkins', '/var/log/jenkins', '/var/cache/jenkins']: }

$user/$user owner/group. , . , .

( : stat -c %U, . Linux.)

+4

All Articles