From 434ba8a72a1811afdfa512384aa75ad1d0ce9784 Mon Sep 17 00:00:00 2001 From: Marcus Young Date: Mon, 17 Nov 2014 13:22:01 -0600 Subject: [PATCH] Issue 2: Changing port does not cause a service restart --- manifests/hbase.pp | 14 +++++++++----- spec/classes/hbase_spec.rb | 6 +++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/manifests/hbase.pp b/manifests/hbase.pp index 8bfcca7..3ecde03 100644 --- a/manifests/hbase.pp +++ b/manifests/hbase.pp @@ -88,6 +88,7 @@ package { 'hbase': ensure => latest, + notify => Service['hbase'], provider => yum, require => [ Yumrepo['HDP-UTILS-1.1.0.17'], @@ -97,25 +98,28 @@ file { '/etc/profile.d/hbase.sh': content => template('hbase/profile_d_hbase.sh.erb'), - replace => true, + group => 'root', mode => '0777', + notify => Service['hbase'], owner => 'root', - group => 'root', + replace => true, }-> exec { 'fix hbase JAVA_HOME': command => 'sed -i.bak "s/export JAVA_HOME=\/usr\/java\/default//g" /usr/lib/hbase/conf/hbase-env.sh; cat /etc/zookeeper/conf/java.env >> /usr/lib/hbase/conf/hbase-env.sh', + notify => Service['hbase'], + onlyif => 'grep -r "export JAVA_HOME=/usr/java/default" /usr/lib/hbase/conf/hbase-env.sh', path => $::path, require => Package['hbase'], - onlyif => 'grep -r "export JAVA_HOME=/usr/java/default" /usr/lib/hbase/conf/hbase-env.sh', }-> file { '/etc/init.d/hbase': content => template('hbase/init_d_hbase.erb'), - replace => true, + group => 'root', mode => '0744', + notify => Service['hbase'], owner => 'root', - group => 'root', + replace => true, }-> service { 'hbase': diff --git a/spec/classes/hbase_spec.rb b/spec/classes/hbase_spec.rb index 8b17def..fb6cb66 100644 --- a/spec/classes/hbase_spec.rb +++ b/spec/classes/hbase_spec.rb @@ -32,9 +32,9 @@ it { should contain_package('hbase').with_ensure('latest').with_provider('yum').with_require('[Yumrepo[HDP-UTILS-1.1.0.17]{:name=>"HDP-UTILS-1.1.0.17"}, Yumrepo[HDP-2.1.4.0]{:name=>"HDP-2.1.4.0"}]') } - it { should contain_file('/etc/profile.d/hbase.sh').with_replace('true').with_mode('0777').with_owner('root').with_group('root') } - it { should contain_exec('fix hbase JAVA_HOME').with_require('Package[hbase]') } - it { should contain_file('/etc/init.d/hbase').with_replace('true').with_mode('0744').with_owner('root').with_group('root') } + it { should contain_file('/etc/profile.d/hbase.sh').with_replace('true').with_mode('0777').with_notify('Service[hbase]').with_owner('root').with_group('root') } + it { should contain_exec('fix hbase JAVA_HOME').with_notify('Service[hbase]').with_require('Package[hbase]') } + it { should contain_file('/etc/init.d/hbase').with_replace('true').with_mode('0744').with_notify('Service[hbase]').with_owner('root').with_group('root') } it { should contain_service('hbase').with_ensure('running') }