Skip to content

Commit

Permalink
Merge pull request #116 from GeorgeCox/manage_cache_dir
Browse files Browse the repository at this point in the history
Added 'manage_dir' parameter to cache_dir
  • Loading branch information
ekohl authored Jan 24, 2019
2 parents 031608d + 52fd5be commit 691121f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 9 additions & 6 deletions manifests/cache_dir.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
String $options = '',
Optional[Integer] $process_number = undef,
String $order = '05',
Boolean $manage_dir = true,
) {

concat::fragment{"squid_cache_dir_${path}":
Expand All @@ -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 {
Expand Down

0 comments on commit 691121f

Please sign in to comment.