From de8c91661dee20a082aa46735d0da238295a4c6b Mon Sep 17 00:00:00 2001 From: Cristian Falcas Date: Wed, 22 Jul 2015 12:55:35 +0300 Subject: [PATCH 1/2] manage systemd unit files optionally --- manifests/init.pp | 2 ++ manifests/service.pp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 4aa68a7a4..482e2f73a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -57,10 +57,12 @@ $java_package = undef, $min_session_timeout = undef, $max_session_timeout = undef, + $manage_systemd = true, ) { validate_array($packages) validate_bool($ensure_cron) + validate_bool($manage_systemd) anchor { 'zookeeper::start': }-> class { 'zookeeper::install': diff --git a/manifests/service.pp b/manifests/service.pp index a415fab2a..280645e14 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -18,7 +18,7 @@ default: { $initstyle = 'unknown' } } - if ($initstyle == 'systemd') { + if ($initstyle == 'systemd' and $manage_systemd) { file { '/usr/lib/systemd/system/zookeeper.service': ensure => 'present', content => template('zookeeper/zookeeper.service.erb'), From b91d9b48d059f2d246978f6c38edb80ad52ea3c0 Mon Sep 17 00:00:00 2001 From: Cristian Falcas Date: Wed, 22 Jul 2015 13:39:17 +0300 Subject: [PATCH 2/2] fix var name --- manifests/service.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/service.pp b/manifests/service.pp index 280645e14..980bb475c 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -18,7 +18,7 @@ default: { $initstyle = 'unknown' } } - if ($initstyle == 'systemd' and $manage_systemd) { + if ($initstyle == 'systemd' and $zookeeper::manage_systemd) { file { '/usr/lib/systemd/system/zookeeper.service': ensure => 'present', content => template('zookeeper/zookeeper.service.erb'),