From 1c0ce337f6cd20f91d50340692749cca2546c97a Mon Sep 17 00:00:00 2001 From: Rianol Jou Date: Tue, 6 Dec 2016 17:33:39 +0800 Subject: [PATCH] Deal with archive_path is declared by other class --- manifests/install.pp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index cc94737..87e30e8 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -25,11 +25,20 @@ } include ::archive - file { [$install_path, "${install_path}/nomad-${::nomad::version}"]: - ensure => directory, - owner => 'root', - group => 0, # 0 instead of root because OS X uses "wheel". - mode => '0555'; + if ! defined(File[$install_path]) { + file { $install_path: + ensure => directory, + owner => 'root', + group => 0, # 0 instead of root because OS X uses "wheel". + mode => '0555', + } + } + file { "${install_path}/nomad-${::nomad::version}": + ensure => directory, + owner => 'root', + group => 0, # 0 instead of root because OS X uses "wheel". + mode => '0555', + require => File[$install_path], }-> archive { "${install_path}/nomad-${::nomad::version}.${::nomad::download_extension}": ensure => present,