puppet archive camtocamp set permissions while extract

asked 2016-05-12 02:26:20 -0500

prototyp gravatar image

Is there anyway to set permissions as a parameter for archive? The permissions should be set while the extraction once. Now I am using the file resource with the recursive param for that. The extracted sources are around 70k files and each puppet run needs above one minute now because of setting or checking the permissions.

Is there any better way to ether set the permissions while extraction or set them once?

          archive {"mySource-${mySource_version}":
                ensure     => present,
                url        => "ftp://mySource.edu/pub/mySource-${mySource_version}.tar.gz",
                target     => "/mySource_data/src/mySource-${mySource_version}",
                extension  => 'tar.gz',
                checksum   => true,
                src_target => '/tmp',
                user       => 'mySourceuser',
                timeout    => 7200,
         file { "/mySource_data/src/mySource-${mySource_version}":
                owner   => $user,
                group   => $user,
                mode    => '0744',
                recurse => true,
edit retag flag offensive close merge delete


Seems, like a accident deleted the comments recursivle because of the deletion of my anwser
So i will recap all your anwsers for short: Puppet catalogs all the files exatracted using the archive type

FranzCC gravatar imageFranzCC ( 2016-05-17 03:46:07 -0500 )edit

You really should look forward to package your file (rpm, deb whatever) and use puppet to deliver the package and then do an execute to extract your tar.gz file

FranzCC gravatar imageFranzCC ( 2016-05-17 03:47:02 -0500 )edit

The source is for developing and puppet should set up the environment. Creating a .deb is not an option!The archive from camptocamp has two major defined types: archive::download() and archive::extract() is it possible to use them one after the other and use file with setting permissions between?

prototyp gravatar imageprototyp ( 2016-05-18 02:15:20 -0500 )edit

No, when checking the source of the "extract" function: https://github.com/camptocamp/puppet-archive/blob/master/manifests/extract.pp
Like i said, choose the right filesystem and use noatime and commit= when using ext4
This can greatly enhance performance

FranzCC gravatar imageFranzCC ( 2016-05-19 03:04:38 -0500 )edit

Yeah I already checked the code... but the module consist of different defined types and my question was if it is possible to use them separately. Placing on chmod in between makes far more sense then optimising an unnecessary procedure!

prototyp gravatar imageprototyp ( 2016-05-19 04:40:58 -0500 )edit