Skip to content

Commit

Permalink
Merge pull request garethr#755 from waipeng/syslog_facility
Browse files Browse the repository at this point in the history
Add syslog_facility parameter to docker::run
  • Loading branch information
adrianiurca authored Jun 22, 2021
2 parents 147aa6e + 9cf1318 commit cd7ec59
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manifests/run.pp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
#
# @param syslog_identifier
#
# @param syslog_facility
#
# @param read_only
#
define docker::run(
Expand Down Expand Up @@ -244,6 +246,7 @@
Optional[Boolean] $remove_volume_on_stop = false,
Optional[Integer] $stop_wait_time = 0,
Optional[String] $syslog_identifier = undef,
Optional[String] $syslog_facility = undef,
Optional[Boolean] $read_only = false,
Optional[String] $health_check_cmd = undef,
Optional[Boolean] $restart_on_unhealthy = false,
Expand Down
3 changes: 3 additions & 0 deletions spec/defines/run_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@
'docker_service' => 'my-docker',
'restart_service_on_docker_refresh' => false,
},
'when passing syslog_facility' => {
'syslog_facility' => 'user',
},
}

describe 'docker::run', type: :define do
Expand Down
3 changes: 3 additions & 0 deletions templates/etc/systemd/system/docker-run.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Environment="HOME=/root"
<%- if @_syslog_identifier -%>
SyslogIdentifier=<%= @_syslog_identifier %>
<%- end -%>
<%- if @syslog_facility -%>
SyslogFacility=<%= @syslog_facility %>
<%- end -%>
ExecStart=/usr/local/bin/docker-run-<%= @sanitised_title %>-start.sh
ExecStop=-/usr/local/bin/docker-run-<%= @sanitised_title %>-stop.sh
<%- if @remain_after_exit %>
Expand Down

0 comments on commit cd7ec59

Please sign in to comment.