Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Issue104_Directory_Resources' in…
Browse files Browse the repository at this point in the history
…to v1.4.0 (#104)
  • Loading branch information
dallinb committed Sep 10, 2015
2 parents 429d545 + 3958f84 commit 4f30aad
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 12 deletions.
27 changes: 27 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,33 @@
notify => Service['cassandra'],
}

file { $commitlog_directory:
ensure => directory,
owner => 'cassandra',
group => 'cassandra',
mode => '0750',
require => Package[$package_name],
notify => Service['cassandra'],
}

file { $data_file_directories:
ensure => directory,
owner => 'cassandra',
group => 'cassandra',
mode => '0750',
require => Package[$package_name],
notify => Service['cassandra'],
}

file { $saved_caches_directory:
ensure => directory,
owner => 'cassandra',
group => 'cassandra',
mode => '0750',
require => Package[$package_name],
notify => Service['cassandra'],
}

if $package_ensure != 'absent'
and $package_ensure != 'purged' {
service { 'cassandra':
Expand Down
36 changes: 24 additions & 12 deletions spec/classes/cassandra_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,30 @@
'value' => 'RAC1'
})
}
it {
should contain_file('/var/lib/cassandra/data').with({
'ensure' => 'directory',
'owner' => 'cassandra',
'group' => 'cassandra',
'mode' => '0750'
})
}
it {
should contain_file('/var/lib/cassandra/commitlog').with({
'ensure' => 'directory',
'owner' => 'cassandra',
'group' => 'cassandra',
'mode' => '0750'
})
}
it {
should contain_file('/var/lib/cassandra/saved_caches').with({
'ensure' => 'directory',
'owner' => 'cassandra',
'group' => 'cassandra',
'mode' => '0750'
})
}
end

context 'On a RedHat OS with manage_dsc_repo set to true' do
Expand Down Expand Up @@ -336,12 +360,10 @@
:client_encryption_keystore => 'foo',
:client_encryption_keystore_password => 'foo',
:cluster_name => 'foo',
:commitlog_directory => 'foo',
:concurrent_counter_writes => 'foo',
:concurrent_reads => 'foo',
:concurrent_writes => 'foo',
:config_path => '/etc',
:data_file_directories => ['foo', 'bar'],
:disk_failure_policy => 'foo',
:endpoint_snitch => 'foo',
:hinted_handoff_enabled => 'foo',
Expand All @@ -354,7 +376,6 @@
:rpc_address => 'foo',
:rpc_port => 'foo',
:rpc_server_type => 'foo',
:saved_caches_directory => 'foo',
:seeds => 'foo',
:server_encryption_internode => 'foo',
:server_encryption_keystore => 'foo',
Expand Down Expand Up @@ -410,11 +431,9 @@
it { should contain_file('/etc/cassandra.yaml').with_content(/keystore_password: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/batch_size_warn_threshold_in_kb: 42/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/cluster_name: 'foo'/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/commitlog_directory: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/concurrent_counter_writes: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/concurrent_reads: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/concurrent_writes: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/^ - foo$/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/disk_failure_policy: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/endpoint_snitch: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/hinted_handoff_enabled: foo/) }
Expand All @@ -427,7 +446,6 @@
it { should contain_file('/etc/cassandra.yaml').with_content(/rpc_address: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/rpc_port: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/rpc_server_type: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/saved_caches_directory: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/ - seeds: "foo"/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/internode_encryption: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/keystore: foo/) }
Expand Down Expand Up @@ -489,9 +507,7 @@
:client_encryption_keystore => 'foo',
:client_encryption_keystore_password => 'foo',
:cluster_name => 'foo',
:commitlog_directory => 'foo',
:config_path => '/etc',
:data_file_directories => ['foo', 'bar'],
:disk_failure_policy => 'foo',
:endpoint_snitch => 'foo',
:hinted_handoff_enabled => 'foo',
Expand All @@ -504,7 +520,6 @@
:rpc_address => 'foo',
:rpc_port => 'foo',
:rpc_server_type => 'foo',
:saved_caches_directory => 'foo',
:seeds => 'foo',
:server_encryption_internode => 'foo',
:server_encryption_keystore => 'foo',
Expand Down Expand Up @@ -559,8 +574,6 @@
it { should contain_file('/etc/cassandra.yaml').with_content(/keystore: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/keystore_password: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/cluster_name: 'foo'/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/commitlog_directory: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/^ - foo$/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/disk_failure_policy: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/endpoint_snitch: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/hinted_handoff_enabled: foo/) }
Expand All @@ -573,7 +586,6 @@
it { should contain_file('/etc/cassandra.yaml').with_content(/rpc_address: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/rpc_port: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/rpc_server_type: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/saved_caches_directory: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/ - seeds: "foo"/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/internode_encryption: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/keystore: foo/) }
Expand Down

0 comments on commit 4f30aad

Please sign in to comment.