Skip to content

Commit

Permalink
Allow service reloading voxpupuli#159 (voxpupuli#175)
Browse files Browse the repository at this point in the history
* Allow service reloading voxpupuli#159

* add restart argument and pass it to the service

* Update manifests/unit_file.pp

Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>

Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>
  • Loading branch information
k0ka and ekohl authored Feb 3, 2021
1 parent ca3f1ed commit 9d20a85
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/unit_file.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
# @param active
# If set, will manage the state of the unit.
#
# @param restart
# Specify a restart command manually. If left unspecified, a standard Puppet service restart happens.
#
define systemd::unit_file (
Enum['present', 'absent', 'file'] $ensure = 'present',
Stdlib::Absolutepath $path = '/etc/systemd/system',
Expand All @@ -58,6 +61,7 @@
Boolean $show_diff = true,
Optional[Variant[Boolean, Enum['mask']]] $enable = undef,
Optional[Boolean] $active = undef,
Optional[String] $restart = undef,
) {
include systemd

Expand Down Expand Up @@ -85,9 +89,11 @@
}

if $enable != undef or $active != undef {

service { $name:
ensure => $active,
enable => $enable,
restart => $restart,
provider => 'systemd',
}

Expand Down

0 comments on commit 9d20a85

Please sign in to comment.