From 52fd5be25d4ff5aa63255e5188e9745609a1d760 Mon Sep 17 00:00:00 2001 From: George Cox Date: Mon, 21 Jan 2019 11:07:35 +0000 Subject: [PATCH] Added 'manage_dir' parameter to cache_dir --- README.md | 3 +++ manifests/cache_dir.pp | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 434f761..b35e35f 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,9 @@ endif * `process_number` if specfied as an integer the cache will be wrapped in a `if $proceess_number` statement so the cache will be used by only one process. Default is undef. +* `manage_dir` Boolean value, if true puppet will attempt to create the + directory, if false you will have to create it yourself. Make sure the + directory has the correct owner, group and mode. Defaults to true. ### Defined Type squid::cache Defines [cache entries](http://www.squid-cache.org/Doc/config/cache/) for a squid server. diff --git a/manifests/cache_dir.pp b/manifests/cache_dir.pp index 467be5c..283ce3b 100644 --- a/manifests/cache_dir.pp +++ b/manifests/cache_dir.pp @@ -4,6 +4,7 @@ String $options = '', Optional[Integer] $process_number = undef, String $order = '05', + Boolean $manage_dir = true, ) { concat::fragment{"squid_cache_dir_${path}": @@ -12,12 +13,14 @@ order => "50-${order}", } - file{$path: - ensure => directory, - owner => $::squid::daemon_user, - group => $::squid::daemon_group, - mode => '0750', - require => Package[$::squid::package_name], + if $manage_dir { + file{$path: + ensure => directory, + owner => $::squid::daemon_user, + group => $::squid::daemon_group, + mode => '0750', + require => Package[$::squid::package_name], + } } if $facts['selinux'] == true {