diff --git a/manifests/init.pp b/manifests/init.pp index 22666d7..7275c50 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -16,6 +16,8 @@ # mode in which yum-cron should perform (valid: 'check', 'download', 'apply') # [*exclude*] # packages to exclude from automatic update (array) +# [*yum_params*] +# any extra yum cmdline parameters like --disablerepo= (only supported on RHEL 5 & 6) # [*notify_email*] # enable email notifications (boolean) # [*email_to*] @@ -56,6 +58,7 @@ $keep_default_hourly = false, $action = 'apply', $exclude = [], + $yum_params = '', $notify_email = true, $email_to = 'root', $email_from = 'root', @@ -68,7 +71,7 @@ validate_bool($service_enable, $notify_email, $default_schedule, $keep_default_hourly) validate_re($action, '^(check|download|apply)$', '$action must be either \'check\', \'download\' or \'apply\'') validate_array($exclude) - validate_string($email_to, $email_from, $update_cmd) + validate_string($email_to, $email_from, $update_cmd, $yum_params) if ($debug_level < -1) or ($debug_level > 10) { fail('$debug_level must be a number between -1 and 10') } if ($error_level < 0) or ($error_level > 10) { fail('$error_level must be a number between 0 and 10') } validate_re($update_cmd, '^(default|security|security-severity:Critical|minimal|minimal-security|minimal-security-severity:Critical)$', '$update_cmd must be either \'default\', \'security\', \'security-severity:Critical\', \'minimal\', \'minimal-security\' or \'minimal-security-severity:Critical\'') diff --git a/manifests/schedule.pp b/manifests/schedule.pp index c81a8da..f471487 100644 --- a/manifests/schedule.pp +++ b/manifests/schedule.pp @@ -8,6 +8,8 @@ # mode in which yum-cron should perform (valid: 'check', 'download', 'apply') # [*exclude*] # packages to exclude from automatic update (array) +# [*yum_params*] +# any extra yum cmdline parameters like --disablerepo= (only supported on RHEL 5 & 6) # [*notify_email*] # enable email notifications (boolean) # [*email_to*] @@ -57,6 +59,7 @@ define yum_autoupdate::schedule ( $action = 'apply', $exclude = [], + $yum_params = '', $notify_email = true, $email_to = 'root', $email_from = 'root', @@ -81,7 +84,7 @@ validate_re($action, '^(check|download|apply)$', '$action must be either \'check\', \'download\' or \'apply\'') validate_array($exclude) validate_bool($notify_email) - validate_string($email_to, $email_from, $update_cmd) + validate_string($email_to, $email_from, $update_cmd, $yum_params) if ($debug_level < -1) or ($debug_level > 10) { fail('$debug_level must be a number between -1 and 10') } if ($error_level < 0) or ($error_level > 10) { fail('$error_level must be a number between 0 and 10') } validate_re($update_cmd, '^(default|security|security-severity:Critical|minimal|minimal-security|minimal-security-severity:Critical)$', '$update_cmd must be either \'default\', \'security\', \'security-severity:Critical\', \'minimal\', \'minimal-security\' or \'minimal-security-severity:Critical\'') diff --git a/templates/conf/rhel5.erb b/templates/conf/rhel5.erb index 686c7b4..7093351 100644 --- a/templates/conf/rhel5.erb +++ b/templates/conf/rhel5.erb @@ -2,7 +2,7 @@ # Managed by Puppet # ****************** -YUM_PARAMETER=<%= @exclude_real %> +YUM_PARAMETER=<% if ! @yum_params.empty? -%>"<%= @yum_params %> "<% end %><%= @exclude_real %> CHECK_ONLY=<% if @action == 'check' -%>yes<% else -%>no<% end %> DOWNLOAD_ONLY=<% if @action == 'download' -%>yes<% else -%>no<% end %> ERROR_LEVEL=<%= @error_level %> diff --git a/templates/conf/rhel6.erb b/templates/conf/rhel6.erb index ebb6ef7..5bebeb0 100644 --- a/templates/conf/rhel6.erb +++ b/templates/conf/rhel6.erb @@ -2,7 +2,7 @@ # Managed by Puppet # ****************** -YUM_PARAMETER=<%= @exclude_real %> +YUM_PARAMETER=<% if ! @yum_params.empty? -%>"<%= @yum_params %> "<% end %><%= @exclude_real %> CHECK_ONLY=<% if @action == 'check' -%>yes<% else -%>no<% end %> DOWNLOAD_ONLY=<% if @action == 'download' -%>yes<% else -%>no<% end %> CHECK_FIRST=no