diff options
Diffstat (limited to 'manifests/server/service.pp')
-rw-r--r-- | manifests/server/service.pp | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/manifests/server/service.pp b/manifests/server/service.pp index 6d24cad..68db2d6 100644 --- a/manifests/server/service.pp +++ b/manifests/server/service.pp @@ -1,27 +1,24 @@ -class samba::server::service ($ensure = running, $enable = true) { - case $::osfamily { - Redhat: { $service_name = 'smb' } - Debian: { $service_name = 'samba' } - Gentoo: { $service_name = 'samba' } +# == Class samba::server::server +# +class samba::server::service ( + $ensure = running, + $enable = true +) inherits samba::server::params { - # Currently Gentoo has $::osfamily = "Linux". This should change in - # Factor 1.7.0 <http://projects.puppetlabs.com/issues/17029>, so - # adding workaround. - Linux: { - case $::operatingsystem { - Gentoo: { $service_name = 'samba' } - default: { fail("$::operatingsystem is not supported by this module.") } - } - } - default: { fail("$::osfamily is not supported by this module.") } - } - - service { "$service_name" : - ensure => $ensure, - hasstatus => true, - hasrestart => true, - enable => $enable, - require => Class['samba::server::config'] + service { $samba::server::params::service_name : + ensure => $ensure, + hasstatus => true, + hasrestart => true, + enable => $enable, + require => Class['samba::server::config'] } + if $samba::server::params::nmbd_name != undef { + service { $samba::server::params::nmbd_name : + ensure => $ensure, + hasrestart => false, + enable => $enable, + require => Class['samba::server::config'], + } + } } |