Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add manage_service parameter #149

Merged
merged 3 commits into from
Nov 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
# Should this module manage the Unix system group under which BIND runs (see
# dns::params)? Defaults to true. Set to false if you want to manage the
# system group yourself.
# @param manage_service
# Should this module manage the dns service?
# This only applies to the service management (running, stopped) and not to
# whether the service should be installed or not.
# Calls to "notify => Service['$dns::namedservicename']" will still be
# executed
# @param namedservicename
# Name of the service
# @param zonefilepath
Expand Down Expand Up @@ -125,6 +131,7 @@
Stdlib::Absolutepath $publicviewpath = $dns::params::publicviewpath,
Stdlib::Absolutepath $vardir = $dns::params::vardir,
Boolean $group_manage = $dns::params::group_manage,
Boolean $manage_service = $dns::params::manage_service,
String $namedservicename = $dns::params::namedservicename,
Stdlib::Absolutepath $zonefilepath = $dns::params::zonefilepath,
Variant[Enum['unmanaged'], Stdlib::Absolutepath] $localzonepath = $dns::params::localzonepath,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
},
}

$manage_service = true
$service_ensure = 'running'
$service_enable = true
$acls = {}
Expand Down
14 changes: 8 additions & 6 deletions manifests/service.pp
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Enable and start dns service
# @api private
class dns::service {
service { $dns::namedservicename:
ensure => $dns::service_ensure,
enable => $dns::service_enable,
hasstatus => true,
hasrestart => true,
restart => $dns::service_restart_command,
if $dns::manage_service {
service { $dns::namedservicename:
ensure => $dns::service_ensure,
enable => $dns::service_enable,
hasstatus => true,
hasrestart => true,
restart => $dns::service_restart_command,
}
}
}