diff --git a/README.md b/README.md index 434f761..01ad492 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,8 @@ endif in a `if $proceess_number` statement so the cache will be used by only one process. Default is undef. +NOTE: When creating a custom 'cache_dir' using Puppet (like a seperate mount) this module WILL NOT create the dir (so no duplicate error occurs), be sure the created directory is owned by the user/group 'squid'. + ### 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..04a28b8 100644 --- a/manifests/cache_dir.pp +++ b/manifests/cache_dir.pp @@ -12,12 +12,14 @@ order => "50-${order}", } - file{$path: - ensure => directory, - owner => $::squid::daemon_user, - group => $::squid::daemon_group, - mode => '0750', - require => Package[$::squid::package_name], + unless defined(File[$path]) { + file{$path: + ensure => directory, + owner => $::squid::daemon_user, + group => $::squid::daemon_group, + mode => '0750', + require => Package[$::squid::package_name], + } } if $facts['selinux'] == true {