Skip to content

Commit

Permalink
add antoineco/aco-yum_autoupdate pr antoineco#9
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Cook committed Apr 4, 2016
1 parent 70e44f4 commit bbd3fe5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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*]
Expand Down Expand Up @@ -56,6 +58,7 @@
$keep_default_hourly = false,
$action = 'apply',
$exclude = [],
$yum_params = '',
$notify_email = true,
$email_to = 'root',
$email_from = 'root',
Expand All @@ -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\'')
Expand Down
5 changes: 4 additions & 1 deletion manifests/schedule.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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*]
Expand Down Expand Up @@ -57,6 +59,7 @@
define yum_autoupdate::schedule (
$action = 'apply',
$exclude = [],
$yum_params = '',
$notify_email = true,
$email_to = 'root',
$email_from = 'root',
Expand All @@ -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\'')
Expand Down
2 changes: 1 addition & 1 deletion templates/conf/rhel5.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
2 changes: 1 addition & 1 deletion templates/conf/rhel6.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bbd3fe5

Please sign in to comment.