diff --git a/manifests/extract.pp b/manifests/extract.pp index fec7335..13f3921 100644 --- a/manifests/extract.pp +++ b/manifests/extract.pp @@ -10,6 +10,7 @@ # - *$extension: Default value '.tar.gz'. # - *$timeout: Default value 120. # - *$exec_path: Path being searched for all Exec resources, default: ['/usr/local/bin', '/usr/bin', '/bin'] +# - *$user: Username to use when extracting # # Example usage: # @@ -35,7 +36,8 @@ $extension = 'tar.gz', $timeout = 120, $strip_components = 0, - $exec_path = ['/usr/local/bin', '/usr/bin', '/bin']) { + $exec_path = ['/usr/local/bin', '/usr/bin', '/bin'], + $user = undef) { if $root_dir != '' { $extract_dir = "${target}/${root_dir}" @@ -67,7 +69,8 @@ command => $unpack_command, path => $exec_path, creates => $extract_dir, - timeout => $timeout + timeout => $timeout, + user => $user } } absent: { diff --git a/manifests/init.pp b/manifests/init.pp index 948011b..c70148d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -22,6 +22,7 @@ # - *$proxy: HTTP proxy in the form of "hostname:port"; e.g. "myproxy:8080" # - *$dependency_class: Puppet class which installs the required programs (curl, tar, unzip) # - *$exec_path: Path being searched for all Exec resources, default: ['/usr/local/bin', '/usr/bin', '/bin'] +# - *$user: Username to use while extracting # # Example usage: # @@ -57,7 +58,8 @@ $password = undef, $proxy = undef, $dependency_class = Class['archive::prerequisites'], - $exec_path = ['/usr/local/bin', '/usr/bin', '/bin']) { + $exec_path = ['/usr/local/bin', '/usr/bin', '/bin'], + $user = undef) { archive::download {"${name}.${extension}": ensure => $ensure, @@ -86,6 +88,7 @@ timeout => $timeout, strip_components => $strip_components, exec_path => $exec_path, - require => Archive::Download["${name}.${extension}"] + require => Archive::Download["${name}.${extension}"], + user => $user } }