Fix #5 Adds a parameter to optionaly manage the service and package

This commit is contained in:
t0xicCode 2016-07-11 08:44:47 -04:00
parent 3938771328
commit 3ba601b3b8
5 changed files with 14 additions and 7 deletions

View File

@ -12,4 +12,3 @@ class nslcd::config inherits nslcd {
}
}

View File

@ -4,9 +4,11 @@
class nslcd (
$package_ensure = $nslcd::params::package_ensure,
$package_name = $nslcd::params::package_name,
$package_manage = $nslcd::params::package_manage,
$service_ensure = $nslcd::params::service_ensure,
$service_enable = $nslcd::params::service_enable,
$service_name = $nslcd::params::service_name,
$service_manage = $nslcd::params::service_manage,
$uid = $nslcd::params::uid,
$gid = $nslcd::params::gid,
$config = $nslcd::params::config,

View File

@ -3,8 +3,10 @@
# Installs the nslcd package.
class nslcd::install inherits nslcd {
package { $nslcd::package_name:
ensure => $nslcd::package_ensure,
if $nslcd::package_manage {
package { $nslcd::package_name:
ensure => $nslcd::package_ensure,
}
}
}

View File

@ -4,8 +4,10 @@
class nslcd::params {
$package_ensure = present
$package_manage = true
$service_ensure = running
$service_enable = true
$service_manage = true
$ldap_uris = ['ldap:///']
$ldap_version = '3'

View File

@ -3,10 +3,12 @@
# Manages the nslcd service.
class nslcd::service inherits nslcd {
service { 'nslcd':
ensure => $nslcd::service_ensure,
enable => $nslcd::service_enable,
name => $nslcd::service_name,
if $nslcd::service_manage {
service { 'nslcd':
ensure => $nslcd::service_ensure,
enable => $nslcd::service_enable,
name => $nslcd::service_name,
}
}
}