Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: add a parameter to define if we manage nfs server service ensure state #183

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@
# String. It defines the servicename of the nfs server service
#
# [*server_service_ensure*]
# Boolean. It defines the service parameter ensure for nfs server services.
# Enum. It defines the service parameter ensure for nfs server services.
#
# [*manage_server_service_ensure*]
# Boolean. It defines if the nfs server service ensure state should be managed.
#
# [*server_service_enable*]
# Boolean. It defines the service parameter enable for nfs server service.
Expand Down Expand Up @@ -228,6 +231,7 @@
Boolean $manage_server_servicehelper = true,
Boolean $manage_client_service = true,
String $server_service_name = $::nfs::params::server_service_name,
Boolean $manage_server_service_ensure = true,
Enum['present', 'absent', 'running', 'stopped', 'disabled'] $server_service_ensure = 'running',
Boolean $server_service_enable = true,
Boolean $server_service_hasrestart = $::nfs::params::server_service_hasrestart,
Expand Down
12 changes: 9 additions & 3 deletions manifests/server/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@

if $::nfs::nfs_v4 == true {

if $::nfs::manage_server_service_ensure {
$server_service_ensure_real = $::nfs::server_service_ensure
} else {
$server_service_ensure_real = undef
}

if $::nfs::server_nfsv4_servicehelper != undef and $::nfs::manage_server_servicehelper {
$server_service_require = Service[$::nfs::server_nfsv4_servicehelper]
$::nfs::server_nfsv4_servicehelper.each |$service_name| {
service { $service_name:
ensure => $::nfs::server_service_ensure,
ensure => $server_service_ensure_real,
enable => $::nfs::server_service_enable,
hasrestart => $::nfs::server_service_hasrestart,
hasstatus => $::nfs::server_service_hasstatus,
Expand All @@ -35,7 +41,7 @@

if $::nfs::manage_server_service {
service { $::nfs::server_service_name:
ensure => $::nfs::server_service_ensure,
ensure => $server_service_ensure_real,
enable => $::nfs::server_service_enable,
hasrestart => $::nfs::server_service_hasrestart,
hasstatus => $::nfs::server_service_hasstatus,
Expand All @@ -48,7 +54,7 @@

if $::nfs::manage_server_service {
service { $::nfs::server_service_name:
ensure => $::nfs::server_service_ensure,
ensure => $server_service_ensure_real,
enable => $::nfs::server_service_enable,
hasrestart => $::nfs::server_service_hasrestart,
hasstatus => $::nfs::server_service_hasstatus,
Expand Down
Loading