From 84824ca6cf663589b0c2d993db2b467fcd7499ac Mon Sep 17 00:00:00 2001 From: Victor Cabezas Date: Thu, 9 May 2019 19:37:24 +0200 Subject: [PATCH] Add support for overriding service restart command --- README.md | 1 + manifests/init.pp | 1 + manifests/params.pp | 1 + manifests/service.pp | 5 +++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b316b9e..72b002d 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ Parameters to the squid class almost map 1 to 1 to squid.conf parameters themsel * `ssl_bump` defaults to undef. If you pass in a hash of ssl_bump entries, they will be defined automatically. [ssl_bump entries](http://www.squid-cache.org/Doc/config/ssl_bump/). * `sslproxy_cert_error` defaults to undef. If you pass in a hash of sslproxy_cert_error entries, they will be defined automatically. [sslproxy_cert_error entries](http://www.squid-cache.org/Doc/config/sslproxy_cert_error/). * `extra_config_sections` defaults to empty hash. If you pass in a hash of `extra_config_section` resources, they will be defined automatically. +* `service_restart` defaults to undef. Overrides service resource restart command to be executed. It can be used to perform a soft reload of the squid service. * `squid_bin_path` path to the squid binary, default depends on `$operatingsystem` ```puppet diff --git a/manifests/init.pp b/manifests/init.pp index 94c5315..794d2e2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -48,6 +48,7 @@ Optional[Hash] $ssl_bump = $squid::params::ssl_bump, Optional[Hash] $sslproxy_cert_error = $squid::params::sslproxy_cert_error, Optional[Integer] $workers = $squid::params::workers, + Optional[String] $service_restart = $squid::params::service_restart, ) inherits ::squid::params { anchor{'squid::begin':} diff --git a/manifests/params.pp b/manifests/params.pp index 9e9aa39..dee6945 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -40,6 +40,7 @@ $logformat = undef $error_directory = undef $err_page_stylesheet = undef + $service_restart = undef $package_ensure = 'present' case $::operatingsystem { diff --git a/manifests/service.pp b/manifests/service.pp index fd66696..7cce17d 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -5,8 +5,9 @@ class squid::service inherits squid { service{$::squid::service_name: - ensure => $squid::ensure_service, - enable => $squid::enable_service, + ensure => $squid::ensure_service, + enable => $squid::enable_service, + restart => $squid::service_restart, } }