From 3ba601b3b802e0d301b0a2466c5de7cd2d61f786 Mon Sep 17 00:00:00 2001 From: t0xicCode Date: Mon, 11 Jul 2016 08:44:47 -0400 Subject: [PATCH] Fix #5 Adds a parameter to optionaly manage the service and package --- manifests/config.pp | 1 - manifests/init.pp | 2 ++ manifests/install.pp | 6 ++++-- manifests/params.pp | 2 ++ manifests/service.pp | 10 ++++++---- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 311043a..7cfb887 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -12,4 +12,3 @@ class nslcd::config inherits nslcd { } } - diff --git a/manifests/init.pp b/manifests/init.pp index 3f8402e..9ac6a41 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, diff --git a/manifests/install.pp b/manifests/install.pp index c32f33d..22d28da 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -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, + } } } diff --git a/manifests/params.pp b/manifests/params.pp index 9bd989d..fc61ce3 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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' diff --git a/manifests/service.pp b/manifests/service.pp index 299ba95..81978dd 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -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, + } } }