Skip to content
This repository has been archived by the owner on Jun 21, 2018. It is now read-only.

Commit

Permalink
Add 'systemname' parameter (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcpunk authored and antoineco committed Jun 7, 2017
1 parent 2f4f8ca commit 31ea50a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ Defaults to `default`

Maximum amount of time in minutes YUM randomly waits before running. Valid values are numbers between `0` and `1440`. `0` to disable. Defaults to `60`

#####`systemname`

Hostname to use for identification. Defaults to `undef` which should be automatically converted to the system hostname.

##To Do

* Add support for passing arbitrary parameters to YUM
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
# enable skip-broken option (boolean)
# [*randomwait*]
# maximum amount of time in minutes YUM randomly waits before running (valid: 0-1440). 0 to disable
# [*systemname*]
# hostname to identify as, defaults to undef
# [*update_cmd*]
# what kind of update to use (valid: default, security, security-severity:Critical, minimal, minimal-security,
# minimal-security-severity:Critical)
Expand Down Expand Up @@ -65,6 +67,7 @@
$error_level = 0,
$skip_broken = false,
$update_cmd = 'default',
$systemname = undef,
$randomwait = 60) inherits yum_autoupdate::params {
# parameters validation
validate_re($service_ensure, '^(stopped|running)$', '$service_ensure must be either \'stopped\', or \'running\'')
Expand Down
4 changes: 4 additions & 0 deletions templates/conf/rhel6.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ CHECK_FIRST=no
ERROR_LEVEL=<%= @error_level %>
DEBUG_LEVEL=<%= @debug_level_real %>
MAILTO=<%= @email_to %>
<% if @systemname and @systename != '' -%>
SYSTEMNAME="<%= @systemname %>"
<% else -%>
#SYSTEMNAME=""
<% end -%>
RANDOMWAIT=<%= @randomwait %>
#DAYS_OF_WEEK="0123456"
CLEANDAY="0"
Expand Down
4 changes: 4 additions & 0 deletions templates/conf/rhel7.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ apply_updates = <% if @action == 'apply' -%>yes<% else -%>no<% end %>
random_sleep = <%= @randomwait %>

[emitters]
<% if @systemname and @systename != '' -%>
system_name = <%= @systemname %>
<% else -%>
system_name = None
<% end -%>
emit_via = <% if @email_to.empty? -%>stdio<% else -%>email<% end %>
output_width = 80

Expand Down

0 comments on commit 31ea50a

Please sign in to comment.