Skip to content

Commit

Permalink
Issue 2: Changing port does not cause a service restart
Browse files Browse the repository at this point in the history
  • Loading branch information
myoung34 committed Nov 17, 2014
1 parent daf675c commit 434ba8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions manifests/hbase.pp
Expand Up @@ -88,6 +88,7 @@

package { 'hbase':
ensure => latest,
notify => Service['hbase'],
provider => yum,
require => [
Yumrepo['HDP-UTILS-1.1.0.17'],
Expand All @@ -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':
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/hbase_spec.rb
Expand Up @@ -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') }

Expand Down

0 comments on commit 434ba8a

Please sign in to comment.