Skip to content

Commit

Permalink
ensure myid symlink to data directory, closes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
deric committed Jan 29, 2015
1 parent f872c27 commit c0983a2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@
notify => Class['zookeeper::service'],
}

file { "${datastore}/myid":
ensure => 'link',
target => "${cfg_dir}/myid",
require => File["${cfg_dir}/myid"]
}

file { "${cfg_dir}/zoo.cfg":
owner => $user,
group => $group,
Expand Down
16 changes: 16 additions & 0 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

describe 'zookeeper::config', :type => :class do

let(:facts) {{
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:lsbdistcodename => 'wheezy',
}}

shared_examples 'common' do |os, codename|
let(:facts) {{
:operatingsystem => os,
Expand Down Expand Up @@ -147,4 +153,14 @@
it_behaves_like 'common', 'Debian', 'wheezy'
end

context 'myid link' do

it { should contain_file(
'/var/lib/zookeeper/myid'
).with({
'ensure' => 'link',
'target' => '/etc/zookeeper/conf/myid',
})}
end

end

0 comments on commit c0983a2

Please sign in to comment.