Page MenuHomeSoftware Heritage

No OneTemporary

diff --git a/.msync.yml b/.msync.yml
index 1a13211..1115a3f 100644
--- a/.msync.yml
+++ b/.msync.yml
@@ -1 +1 @@
-modulesync_config_version: '1.9.2'
+modulesync_config_version: '1.9.4'
diff --git a/.travis.yml b/.travis.yml
index 2efe490..b7b75a7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,52 +1,49 @@
---
sudo: false
dist: trusty
language: ruby
cache: bundler
-# related to https://github.com/rubygems/rubygems/issues/2123
before_install:
- - 'rm -f Gemfile.lock'
- - 'gem update --system'
- - 'gem install bundler'
+ - rm -f Gemfile.lock
script:
- 'bundle exec rake $CHECK'
matrix:
fast_finish: true
include:
- rvm: 2.1.9
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test
- rvm: 2.5.1
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
- rvm: 2.5.1
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
branches:
only:
- master
- /^v\d/
notifications:
email: false
irc:
on_success: always
on_failure: always
channels:
- "chat.freenode.org#voxpupuli-notifications"
deploy:
provider: puppetforge
user: puppet
password:
secure: ""
on:
tags: true
# all_branches is required to use tags
all_branches: true
# Only publish the build marked with "DEPLOY_TO_FORGE"
condition: "$DEPLOY_TO_FORGE = yes"
diff --git a/Gemfile b/Gemfile
index 1527b39..8da95fb 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,78 +1,81 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"
def location_for(place, fake_version = nil)
if place =~ /^(git[:@][^#]*)#(.*)/
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
elsif place =~ /^file:\/\/(.*)/
['>= 0', { :path => File.expand_path($1), :require => false }]
else
[place, { :require => false }]
end
end
group :test do
- gem 'puppetlabs_spec_helper', '~> 2.6.0', :require => false
+ gem 'puppetlabs_spec_helper', '~> 2.6', :require => false
gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'puppet-lint-version_comparison-check', :require => false
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'metadata-json-lint', :require => false
gem 'redcarpet', :require => false
gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'mocha', '~> 1.4.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'parallel_tests', :require => false
end
group :development do
gem 'travis', :require => false
gem 'travis-lint', :require => false
gem 'guard-rake', :require => false
gem 'overcommit', '>= 0.39.1', :require => false
end
group :system_tests do
gem 'winrm', :require => false
if beaker_version = ENV['BEAKER_VERSION']
gem 'beaker', *location_for(beaker_version)
else
gem 'beaker', '>= 3.9.0', :require => false
end
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
gem 'beaker-rspec', *location_for(beaker_rspec_version)
else
gem 'beaker-rspec', :require => false
end
gem 'serverspec', :require => false
gem 'beaker-hostgenerator', '>= 1.1.10', :require => false
gem 'beaker-puppet_install_helper', :require => false
gem 'beaker-module_install_helper', :require => false
+ gem 'rbnacl', '~> 4', :require => false if RUBY_VERSION >= '2.2.6'
+ gem 'rbnacl-libsodium', :require => false if RUBY_VERSION >= '2.2.6'
+ gem 'bcrypt_pbkdf', :require => false
end
group :release do
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/skywinder/github-changelog-generator' if RUBY_VERSION >= '2.2.2'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
- gem 'puppet-strings', '~> 1.0', :require => false
+ gem 'puppet-strings', '>= 1.0', :require => false
end
if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion.to_s, :require => false, :groups => [:test]
else
gem 'facter', :require => false, :groups => [:test]
end
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 5.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]
# vim: syntax=ruby
diff --git a/spec/classes/datastax_agent_spec.rb b/spec/classes/datastax_agent_spec.rb
index 40992d4..ec0e5c3 100644
--- a/spec/classes/datastax_agent_spec.rb
+++ b/spec/classes/datastax_agent_spec.rb
@@ -1,129 +1,130 @@
require 'spec_helper'
describe 'cassandra::datastax_agent' do
context 'Test for cassandra::datastax_agent with defaults (RedHat).' do
let :facts do
{
osfamily: 'RedHat',
operatingsystemmajrelease: '6'
}
end
it do
+ is_expected.to compile.with_all_deps
+
is_expected.to have_resource_count(10)
- is_expected.to contain_class('cassandra::datastax_agent').only_with(
+ is_expected.to contain_class('cassandra::datastax_agent').with(
'address_config_file' => '/var/lib/datastax-agent/conf/address.yaml',
'defaults_file' => '/etc/default/datastax-agent',
'package_ensure' => 'present',
'package_name' => 'datastax-agent',
'service_ensure' => 'running',
'service_enable' => true,
'service_name' => 'datastax-agent',
- 'stomp_interface' => nil,
- 'local_interface' => nil
+ 'settings' => {}
)
is_expected.to contain_package('datastax-agent').with(
ensure: 'present',
notify: 'Exec[datastax_agent_reload_systemctl]'
).that_notifies('Exec[datastax_agent_reload_systemctl]')
is_expected.to contain_exec('datastax_agent_reload_systemctl').only_with(
command: '/usr/bin/systemctl daemon-reload',
onlyif: 'test -x /usr/bin/systemctl',
path: ['/usr/bin', '/bin'],
refreshonly: true,
notify: 'Service[datastax-agent]'
).that_notifies('Service[datastax-agent]')
is_expected.to contain_file('/var/lib/datastax-agent/conf/address.yaml').
with(
owner: 'cassandra',
group: 'cassandra',
mode: '0644'
).that_requires('Package[datastax-agent]')
is_expected.to contain_service('datastax-agent').only_with(
ensure: 'running',
enable: true,
name: 'datastax-agent'
)
end
end
context 'Test for cassandra::datastax_agent with defaults (Debian).' do
let :facts do
{
osfamily: 'Debian',
operatingsystemmajrelease: '6'
}
end
it do
is_expected.to contain_exec('datastax_agent_reload_systemctl').with(
command: '/bin/systemctl daemon-reload',
onlyif: 'test -x /bin/systemctl',
path: ['/usr/bin', '/bin'],
refreshonly: true
).that_notifies('Service[datastax-agent]')
end
end
context 'Test that the JAVA_HOME can be set.' do
let :facts do
{
osfamily: 'Debian',
operatingsystemmajrelease: '6'
}
end
let :params do
{
java_home: '/usr/lib/jvm/java-8-oracle'
}
end
it do
is_expected.to contain_ini_setting('java_home').with(
ensure: 'present',
path: '/etc/default/datastax-agent',
section: '',
key_val_separator: '=',
setting: 'JAVA_HOME',
value: '/usr/lib/jvm/java-8-oracle'
).that_notifies('Service[datastax-agent]')
end
end
context 'Test settings.' do
let :facts do
{
osfamily: 'Debian',
operatingsystemmajrelease: '6'
}
end
let :params do
{
settings: {
'agent_alias' => {
'setting' => 'agent_alias',
'value' => 'foobar'
},
'stomp_interface' => {
'setting' => 'stomp_interface',
'value' => 'localhost'
},
'async_pool_size' => {
'ensure' => 'absent'
}
}
}
end
it do
is_expected.to have_resource_count(16)
end
end
end
diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb
index e5a01bd..82afc99 100644
--- a/spec/classes/init_spec.rb
+++ b/spec/classes/init_spec.rb
@@ -1,389 +1,390 @@
require 'spec_helper'
describe 'cassandra' do
context 'On an unknown OS with defaults for all parameters' do
let :facts do
{
operatingsystemmajrelease: '10',
osfamily: 'Darwin'
}
end
it { is_expected.to raise_error(Puppet::Error) }
end
context 'Test the default parameters (RedHat)' do
let :facts do
{
osfamily: 'RedHat',
operatingsystemmajrelease: '7'
}
end
it do
is_expected.to contain_package('cassandra').with(
ensure: 'present',
name: 'cassandra22'
).that_notifies('Exec[cassandra_reload_systemctl]')
is_expected.to contain_exec('cassandra_reload_systemctl').only_with(
command: '/usr/bin/systemctl daemon-reload',
onlyif: 'test -x /usr/bin/systemctl',
path: ['/usr/bin', '/bin'],
refreshonly: true
)
is_expected.to contain_file('/etc/cassandra/default.conf').with(
ensure: 'directory',
group: 'cassandra',
owner: 'cassandra',
mode: '0755'
).that_requires('Package[cassandra]')
is_expected.to contain_file('/etc/cassandra/default.conf/cassandra.yaml').
with(
ensure: 'present',
owner: 'cassandra',
group: 'cassandra',
mode: '0644'
).
that_requires('Package[cassandra]')
is_expected.to contain_class('cassandra').only_with(
baseline_settings: {},
cassandra_2356_sleep_seconds: 5,
cassandra_9822: false,
cassandra_yaml_tmpl: 'cassandra/cassandra.yaml.erb',
commitlog_directory_mode: '0750',
manage_config_file: true,
config_file_mode: '0644',
config_path: '/etc/cassandra/default.conf',
data_file_directories_mode: '0750',
dc: 'DC1',
fail_on_non_supported_os: true,
hints_directory_mode: '0750',
package_ensure: 'present',
package_name: 'cassandra22',
rack: 'RAC1',
rackdc_tmpl: 'cassandra/cassandra-rackdc.properties.erb',
saved_caches_directory_mode: '0750',
service_enable: true,
service_name: 'cassandra',
service_provider: nil,
service_refresh: true,
settings: {},
+ snitch_properties_file: 'cassandra-rackdc.properties',
systemctl: '/usr/bin/systemctl'
)
end
end
context 'On RedHat 7 with data directories specified.' do
let :facts do
{
osfamily: 'RedHat',
operatingsystemmajrelease: '7'
}
end
let :params do
{
commitlog_directory: '/var/lib/cassandra/commitlog',
data_file_directories: ['/var/lib/cassandra/data'],
hints_directory: '/var/lib/cassandra/hints',
saved_caches_directory: '/var/lib/cassandra/saved_caches',
settings: { 'cluster_name' => 'MyCassandraCluster' }
}
end
it do
is_expected.to have_resource_count(10)
is_expected.to contain_file('/var/lib/cassandra/commitlog')
is_expected.to contain_file('/var/lib/cassandra/data')
is_expected.to contain_file('/var/lib/cassandra/hints')
is_expected.to contain_file('/var/lib/cassandra/saved_caches')
end
end
context 'On RedHat 7 with service provider set to init.' do
let :facts do
{
osfamily: 'RedHat',
operatingsystemmajrelease: '7'
}
end
let :params do
{
service_provider: 'init'
}
end
it do
is_expected.to have_resource_count(7)
is_expected.to contain_exec('/sbin/chkconfig --add cassandra').with(
unless: '/sbin/chkconfig --list cassandra'
).
that_requires('Package[cassandra]').
that_comes_before('Service[cassandra]')
end
end
context 'On a Debian OS with defaults for all parameters' do
let :facts do
{
operatingsystemmajrelease: '8',
osfamily: 'Debian'
}
end
it do
is_expected.to contain_class('cassandra')
is_expected.to contain_group('cassandra').with_ensure('present')
is_expected.to contain_package('cassandra').with(
ensure: 'present',
name: 'cassandra'
).that_notifies('Exec[cassandra_reload_systemctl]')
is_expected.to contain_exec('cassandra_reload_systemctl').only_with(
command: '/bin/systemctl daemon-reload',
onlyif: 'test -x /bin/systemctl',
path: ['/usr/bin', '/bin'],
refreshonly: true
)
is_expected.to contain_service('cassandra').with(
ensure: nil,
name: 'cassandra',
enable: 'true'
)
is_expected.to contain_exec('CASSANDRA-2356 sleep').
with(
command: '/bin/sleep 5',
refreshonly: true,
user: 'root'
).
that_subscribes_to('Package[cassandra]').
that_comes_before('Service[cassandra]')
is_expected.to contain_user('cassandra').
with(
ensure: 'present',
comment: 'Cassandra database,,,',
gid: 'cassandra',
home: '/var/lib/cassandra',
shell: '/bin/false',
managehome: true
).
that_requires('Group[cassandra]')
is_expected.to contain_file('/etc/cassandra').with(
ensure: 'directory',
group: 'cassandra',
owner: 'cassandra',
mode: '0755'
)
is_expected.to contain_file('/etc/cassandra/cassandra.yaml').
with(
ensure: 'present',
owner: 'cassandra',
group: 'cassandra',
mode: '0644'
).
that_comes_before('Package[cassandra]').
that_requires(['User[cassandra]', 'File[/etc/cassandra]'])
is_expected.to contain_file('/etc/cassandra/cassandra-rackdc.properties').
with(
ensure: 'file',
owner: 'cassandra',
group: 'cassandra',
mode: '0644'
).
that_requires(['File[/etc/cassandra]', 'User[cassandra]']).
that_comes_before('Package[cassandra]')
is_expected.to contain_service('cassandra').
that_subscribes_to(
[
'File[/etc/cassandra/cassandra.yaml]',
'File[/etc/cassandra/cassandra-rackdc.properties]',
'Package[cassandra]'
]
)
end
end
context 'CASSANDRA-9822 activated on Debian' do
let :facts do
{
operatingsystemmajrelease: '7',
osfamily: 'Debian',
lsbdistid: 'Ubuntu',
lsbdistrelease: '14.04'
}
end
let :params do
{
cassandra_9822: true
}
end
it do
is_expected.to contain_file('/etc/init.d/cassandra').with(
source: 'puppet:///modules/cassandra/CASSANDRA-9822/cassandra',
mode: '0555'
).that_comes_before('Package[cassandra]')
end
end
context 'Install DSE on a Red Hat family OS.' do
let :facts do
{
operatingsystemmajrelease: '7',
osfamily: 'RedHat'
}
end
let :params do
{
package_ensure: '4.7.0-1',
package_name: 'dse-full',
config_path: '/etc/dse/cassandra',
service_name: 'dse'
}
end
it do
is_expected.to contain_file('/etc/dse/cassandra/cassandra.yaml').that_notifies('Service[cassandra]')
is_expected.to contain_file('/etc/dse/cassandra')
is_expected.to contain_file('/etc/dse/cassandra/cassandra-rackdc.properties').
with(
ensure: 'file',
owner: 'cassandra',
group: 'cassandra',
mode: '0644'
).
that_notifies('Service[cassandra]')
is_expected.to contain_package('cassandra').with(
ensure: '4.7.0-1',
name: 'dse-full'
)
is_expected.to contain_service('cassandra').with_name('dse')
end
end
context 'On an unsupported OS pleading tolerance' do
let :facts do
{
operatingsystemmajrelease: '10',
osfamily: 'Darwin'
}
end
let :params do
{
config_file_mode: '0755',
config_path: '/etc/cassandra',
fail_on_non_supported_os: false,
package_name: 'cassandra',
service_provider: 'base',
systemctl: '/bin/true'
}
end
it do
is_expected.to contain_file('/etc/cassandra/cassandra.yaml').with('mode' => '0755')
is_expected.to contain_service('cassandra').with(provider: 'base')
is_expected.to have_resource_count(6)
end
end
context 'Ensure cassandra service can be stopped and disabled.' do
let :facts do
{
operatingsystemmajrelease: '8',
osfamily: 'Debian'
}
end
let :params do
{
service_ensure: 'stopped',
service_enable: 'false'
}
end
it do
is_expected.to contain_service('cassandra').
with(ensure: 'stopped',
name: 'cassandra',
enable: 'false')
end
end
context 'Test the dc and rack properties with defaults (Debian).' do
let :facts do
{
operatingsystemmajrelease: '8',
osfamily: 'Debian'
}
end
it do
is_expected.to contain_file('/etc/cassandra/cassandra-rackdc.properties').
with_content(%r{^dc=DC1}).
with_content(%r{^rack=RAC1$}).
with_content(%r{^#dc_suffix=$}).
with_content(%r{^# prefer_local=true$})
end
end
context 'Test the dc and rack properties with defaults (RedHat).' do
let :facts do
{
operatingsystemmajrelease: '7',
osfamily: 'RedHat'
}
end
it do
is_expected.to contain_file('/etc/cassandra/default.conf/cassandra-rackdc.properties').
with_content(%r{^dc=DC1}).
with_content(%r{^rack=RAC1$}).
with_content(%r{^#dc_suffix=$}).
with_content(%r{^# prefer_local=true$})
end
end
context 'Test the dc and rack properties.' do
let :facts do
{
operatingsystemmajrelease: '7',
osfamily: 'RedHat'
}
end
let :params do
{
snitch_properties_file: 'cassandra-topology.properties',
dc: 'NYC',
rack: 'R101',
dc_suffix: '_1_cassandra',
prefer_local: 'true'
}
end
it do
is_expected.to contain_file('/etc/cassandra/default.conf/cassandra-topology.properties').
with_content(%r{^dc=NYC$}).
with_content(%r{^rack=R101$}).
with_content(%r{^dc_suffix=_1_cassandra$}).
with_content(%r{^prefer_local=true$})
end
end
end

File Metadata

Mime Type
text/x-diff
Expires
Mon, Aug 18, 10:39 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3336271

Event Timeline