diff --git a/util/manifests/init.pp b/util/manifests/init.pp index aaf5e90..544c55c 100644 --- a/util/manifests/init.pp +++ b/util/manifests/init.pp @@ -38,8 +38,11 @@ define util::extract::tar($source, $ensure=present, $strip=0, $preserve=false) { file { "${name}": ensure => directory, mode => 0755, - owner => root, - group => root, + owner => "root", + group => $operatingsystem ? { + "openbsd" => "wheel", + default => "root", + }, } case regsubst($source, '.*\.([^.]+)$', '\1') { @@ -48,14 +51,19 @@ define util::extract::tar($source, $ensure=present, $strip=0, $preserve=false) { bz2, tbz: { $cat = "bzcat" } } + $tar = $operatingsystem ? { + "openbsd" => "gtar", + default => "tar", + } + if $preserve { - $command = "${cat} ${source} | tar xf - --strip-components=${strip} -C ${name}" + $command = "${cat} ${source} | ${tar} xf - --strip-components=${strip} -C ${name}" } else { - $command = "${cat} ${source} | tar xf - --strip-components=${strip} -C ${name} --no-same-owner --no-same-permissions" + $command = "${cat} ${source} | ${tar} xf - --strip-components=${strip} -C ${name} --no-same-owner --no-same-permissions" } exec { "tar-extract-${name}": - path => "/bin:/usr/bin:/sbin:/usr/sbin", + path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin", command => $command, require => File["${name}"], unless => "test -n \"$(ls -A ${name})\"",