From 6598d5513789da791e7f0685d15b7c28396e221e Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Wed, 16 Aug 2017 16:21:11 +0200 Subject: [PATCH] Allow uncompressed daemons This is the case for the apache and postgres exporters --- manifests/daemon.pp | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/manifests/daemon.pp b/manifests/daemon.pp index a59d09664..60771e7f2 100644 --- a/manifests/daemon.pp +++ b/manifests/daemon.pp @@ -25,16 +25,32 @@ case $install_method { 'url': { - archive { "/tmp/${name}-${version}.${download_extension}": - ensure => present, - extract => true, - extract_path => '/opt', - source => $real_download_url, - checksum_verify => false, - creates => "/opt/${name}-${version}.${os}-${arch}/${name}", - cleanup => true, + if $download_extension == '' { + file { "/opt/${name}-${version}.${os}-${arch}": + ensure => directory, + owner => 'root', + group => 0, # 0 instead of root because OS X uses "wheel". + mode => '0755', + } + -> archive { "/opt/${name}-${version}.${os}-${arch}/${name}": + ensure => present, + source => $real_download_url, + checksum_verify => false, + before => File["/opt/${name}-${version}.${os}-${arch}/${name}"], + } + } else { + archive { "/tmp/${name}-${version}.${download_extension}": + ensure => present, + extract => true, + extract_path => '/opt', + source => $real_download_url, + checksum_verify => false, + creates => "/opt/${name}-${version}.${os}-${arch}/${name}", + cleanup => true, + before => File["/opt/${name}-${version}.${os}-${arch}/${name}"], + } } - -> file { "/opt/${name}-${version}.${os}-${arch}/${name}": + file { "/opt/${name}-${version}.${os}-${arch}/${name}": owner => 'root', group => 0, # 0 instead of root because OS X uses "wheel". mode => '0555',