Skip to content

Commit

Permalink
Release 2.6.0 (voxpupuli#402)
Browse files Browse the repository at this point in the history
* Integration with github_changelog_generator

* Release 2.5.0

* Bugfix-397: Spec tests not working. (voxpupuli#398)

* voxpupuli#395 Adding Red Hat OS (voxpupuli#396)

* voxpupuli#395 Implement apache repo for Red Hat

* voxpupuli#395 Adding Red Hat OS

Adding Red Hat OS for the Apache repo

* voxpupuli#395 Add release to the URL

* Adding gpg key to yum

* Cassandra 3.X and Debian 7 clash over GLIBC version. (voxpupuli#399)

* Implement apache_repo for RedHat (voxpupuli#400)

Fixes voxpupuli#395.

* [blacksmith] Bump version to 2.6.0

* Update to the changelog for 2.6.0.

* Corrected CHANGELOG and added stijnvdb to CONTRIBUTERS.
  • Loading branch information
dallinb authored Sep 11, 2017
1 parent d180a6c commit 40f8045
Show file tree
Hide file tree
Showing 16 changed files with 169 additions and 46 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@ script:
- "bundle exec rake acceptance"
notifications:
email: false
matrix:
fast_finish: true
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## [2.6.0](https://github.com/locp/cassandra/tree/2.6.0) (2017-09-11)
[Full Changelog](https://github.com/locp/cassandra/compare/2.5.0...2.6.0)

**Fixed bugs:**

- Unit and acceptance tests are failing that have been successful in the past. [\#397](https://github.com/locp/cassandra/issues/397)

**Merged pull requests:**

- Implement apache_repo for RedHat [\#396](https://github.com/locp/cassandra/pull/396) ([stijnvdb](https://github.com/stijnvdb))

## [2.5.0](https://github.com/locp/cassandra/tree/2.5.0) (2017-05-31)
[Full Changelog](https://github.com/locp/cassandra/compare/2.4.1...2.5.0)

Expand Down Expand Up @@ -1136,4 +1147,4 @@ Added more attributes and improved the module metadata.
An initial release with **VERY** limited options.


\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ bundle exec rake beaker:ubuntu1604

**Release** | **PR/Issue** | **Contributer**
------------|-----------------------------------------------------|----------------------------------------------------
2.6.0 | [Adding Red Hat OS](https://github.com/locp/cassandra/pull/396) | [@stijnvdb](https://github.com/stijnvdb)
2.3.0 | [Hiera documentation](https://github.com/locp/cassandra/pull/329) | [@tibers](https://github.com/tibers)
2.1.1 | [Correct cql_types conditional in cassandra::schema class](https://github.com/locp/cassandra/pull/325)| [@aaron-miller](https://github.com/aaron-miller)
2.0.2 | [locp/cassandra 2.0 example has two cassandra declarations](https://github.com/locp/cassandra/issues/291)| [@ericy-jana](https://github.com/ericy-jana)
Expand Down
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['>= 3.8']
puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['~> 4.0']

# github_changelog_generator must be 1.13.0 for ruby < 2.2.2
github_changelog_generator_version = RUBY_VERSION < '2.2.2' ? '~> 1.13.0' : '>= 1.13.0'

# github_changelog_generator must be 1.13.0 for ruby < 2.2.2
github_changelog_generator_version = RUBY_VERSION < '2.2.2' ? '~> 1.13.0' : '>= 1.13.0'
Expand All @@ -22,6 +25,7 @@ group :test do
gem 'rspec-puppet-utils', require: false
gem 'rspec_junit_formatter', require: false
gem 'rubocop-rspec', '1.4.1' if RUBY_VERSION < '2.2.0'
gem 'semantic_puppet', require: false
gem 'travis', require: false
gem 'travis-lint', require: false
gem 'yard', require: false
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,9 @@ is made to the Puppet manifest but the resource already exits, this change
will not be reflected.
* At the moment the `cassandra::system::transparent_hugepage` does not
persist between reboots.
* Currently Apache Cassandra only provides binary packages for Debian so
the `cassandra::apache_repo` is not of much use to Red Hat family users.
* Acceptance for Debian 7 are confined to Cassandra 2.1 and 2.2. There is
a conflict between the GLIBC on Debian 7 and the newer releases of Cassandra
3.X.

## Development

Expand Down
40 changes: 28 additions & 12 deletions manifests/apache_repo.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# An optional class that will allow a suitable repository to be configured
# from which packages for Apache Cassandra can be downloaded. Changing
# the defaults will allow any Debian Apt repository to be configured.
# Currently Apache only provide a Debian repository
# (http://cassandra.apache.org/download/) mentions of Yum are for wishful
# thinking.
# from which packages for Apache Cassandra can be downloaded.
# @param descr [string] On the Red Hat family, this is passed as the `descr`
# attribute to a `yumrepo` resource. On the Debian family, it is passed as
# the `comment` attribute to an `apt::source` resource.
Expand All @@ -12,15 +8,18 @@
# ignored.
# @param key_url [string] On the Debian family, this is passed as the
# `source` attribute to an `apt::key` resource. On the Red Hat family,
# it is ignored.
# @param pkg_url [string] If left as the default, this will set the `baseurl`
# to 'http://rpm.datastax.com/community' on a `yumrepo` resource
# on the Red Hat family. On the Debian family, leaving this as the default
# it is set to the `gpgkey` attribute on the `yumrepo` resource.
# @param pkg_url [string] On the Red Hat family, leaving this as default will
# set the `baseurl` on the `yumrepo` resource to
# 'http://www.apache.org/dist/cassandra/redhat' with whatever is set in the
# 'release' attribute appended.
# On the Debian family, leaving this as the default
# will set the `location` attribute on an `apt::source` to
# 'http://www.apache.org/dist/cassandra/debian'.
# @param release [string] On the Debian family, this is passed as the `release`
# attribute to an `apt::source` resource. On the Red Hat family, it is
# ignored.
# attribute to an `apt::source` resource. On the Red Hat family, it is the
# major version number of Cassandra, without dot, and with an appended 'x'
# (e.g. '311x')
class cassandra::apache_repo (
$descr = 'Repo for Apache Cassandra',
$key_id = 'A26E528B271F19B9E5D8E19EA278B781FE4B2BDA',
Expand All @@ -29,6 +28,23 @@
$release = 'main',
) {
case $::osfamily {
'RedHat': {
if $pkg_url != undef {
$baseurl = $pkg_url
} else {
$url = 'http://www.apache.org/dist/cassandra/redhat'
$baseurl = "${url}/${release}"
}

yumrepo { 'cassandra_apache':
ensure => present,
descr => $descr,
baseurl => $baseurl,
enabled => 1,
gpgcheck => 1,
gpgkey => $key_url,
}
}
'Debian': {
include apt
include apt::update
Expand Down Expand Up @@ -66,4 +82,4 @@
warning("OS family ${::osfamily} not supported")
}
}
}
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "locp-cassandra",
"version": "2.5.0",
"version": "2.6.0",
"author": "locp",
"summary": "Installs Cassandra & DataStax Agent on RHEL/Ubuntu/Debian.",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/bootstrap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

osfamily = fact('osfamily')
roles = hosts[0]['roles']
t = TestManifests.new(roles, 0)
t = TestManifests.new(roles, 0, 0)
bootstrap_pp = t.bootstrap_pp()

describe 'Test Entry Criteria' do
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/cassandra_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
versions.push(3.0) if roles.include? 'cassandra3'

versions.each do |version|
t = TestManifests.new(roles, version)
t = TestManifests.new(roles, version, fact('operatingsystemmajrelease'))

describe "Cassandra #{version} installation." do
# firewall_pp = t.firewall_pp()
Expand Down
13 changes: 6 additions & 7 deletions spec/acceptance/nodesets/debian7.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
---
CONFIG:
---
CONFIG:
log_level: notice
type: foss
HOSTS:
debian7:
docker_image_commands:
HOSTS:
debian7:
docker_image_commands:
- "apt-get install -y wget"
hypervisor: docker
image: "debian:7"
platform: debian-7-amd64
roles:
roles:
- cassandra2
- cassandra3
- firewall
78 changes: 78 additions & 0 deletions spec/classes/apache_repo_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
require 'spec_helper'
describe 'cassandra::apache_repo' do
let(:pre_condition) do
[
'class apt () {}',
'class apt::update () {}',
'define apt::key ($id, $source) {}',
'define apt::source ($location, $comment, $release, $include) {}'
]
end

context 'On a RedHat OS with defaults for all parameters' do
let :facts do
{
osfamily: 'RedHat'
}
end

let :params do
{
release: '311x'
}
end

it do
should have_resource_count(1)

should contain_class('cassandra::apache_repo').only_with(
'descr' => 'Repo for Apache Cassandra',
'key_id' => 'A26E528B271F19B9E5D8E19EA278B781FE4B2BDA',
'key_url' => 'https://www.apache.org/dist/cassandra/KEYS',
'release' => '311x'
)

should contain_yumrepo('cassandra_apache').with(
ensure: 'present',
descr: 'Repo for Apache Cassandra',
baseurl: 'http://www.apache.org/dist/cassandra/redhat/311x',
enabled: 1,
gpgcheck: 1,
gpgkey: 'https://www.apache.org/dist/cassandra/KEYS'
)
end
end

context 'On a Debian OS with defaults for all parameters' do
let :facts do
{
osfamily: 'Debian',
lsbdistid: 'Ubuntu',
lsbdistrelease: '14.04'
}
end

it do
should have_resource_count(3)
should contain_class('apt')
should contain_class('apt::update')

should contain_apt__key('apache.cassandra').with(
id: 'A26E528B271F19B9E5D8E19EA278B781FE4B2BDA',
source: 'https://www.apache.org/dist/cassandra/KEYS'
)

should contain_apt__source('cassandra.sources').with(
location: 'http://www.apache.org/dist/cassandra/debian',
comment: 'Repo for Apache Cassandra',
release: 'main',
include: { 'src' => false }
).that_notifies('Exec[update-apache-cassandra-repo]')

should contain_exec('update-apache-cassandra-repo').with(
refreshonly: true,
command: '/bin/true'
)
end
end
end
1 change: 0 additions & 1 deletion spec/classes/datastax_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

should contain_class('cassandra::datastax_agent').only_with(
'defaults_file' => '/etc/default/datastax-agent',
'java_home' => nil,
'package_ensure' => 'present',
'package_name' => 'datastax-agent',
'service_ensure' => 'running',
Expand Down
1 change: 0 additions & 1 deletion spec/classes/datastax_repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
'descr' => 'DataStax Repo for Apache Cassandra',
'key_id' => '7E41C00F85BFC1706C4FFFB3350200F2B999A372',
'key_url' => 'http://debian.datastax.com/debian/repo_key',
'pkg_url' => nil,
'release' => 'stable'
)

Expand Down
2 changes: 0 additions & 2 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
config_path: '/etc/cassandra/default.conf',
data_file_directories_mode: '0750',
dc: 'DC1',
dc_suffix: nil,
fail_on_non_supported_os: true,
hints_directory_mode: '0750',
package_ensure: 'present',
Expand All @@ -83,7 +82,6 @@
rackdc_tmpl: 'cassandra/cassandra-rackdc.properties.erb',
saved_caches_directory_mode: '0750',
service_enable: true,
# service_ensure: nil,
service_name: 'cassandra',
service_provider: nil,
service_refresh: true,
Expand Down
3 changes: 1 addition & 2 deletions spec/classes/schema_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
cqlsh_host: 'localhost',
cqlsh_password: nil,
cqlsh_port: 9042,
cqlsh_user: 'cassandra',
keyspaces: [])
cqlsh_user: 'cassandra')

read_command = '/usr/bin/cqlsh -e \'DESC KEYSPACES\' localhost 9042'

Expand Down
44 changes: 32 additions & 12 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'pry'

class TestManifests
def initialize(roles, version)
def initialize(roles, version, operatingsystemmajrelease)
# Instance variables
@roles = roles
@version = version
Expand All @@ -12,32 +12,41 @@ def initialize(roles, version)
elsif version == 2.2
init22
elsif version == 3.0
init30
init30(operatingsystemmajrelease)
end
end

def init21
@debian_release = '21x'
@debian_package_ensure = '2.1.17'
@debian_package_ensure = '2.1.18'
@redhat_package_ensure = '2.1.15-1'
@cassandra_optutils_package = 'cassandra21-tools'
@cassandra_package = 'cassandra21'
end

def init22
@debian_release = '22x'
@debian_package_ensure = '2.2.9'
@debian_package_ensure = '2.2.10'
@redhat_package_ensure = '2.2.8-1'
@cassandra_optutils_package = 'cassandra22-tools'
@cassandra_package = 'cassandra22'
end

def init30
def init30(operatingsystemmajrelease)
@debian_release = '30x'
@debian_package_ensure = '3.0.13'
@redhat_package_ensure = '3.0.9-1'
@cassandra_optutils_package = 'cassandra30-tools'
@cassandra_package = 'cassandra30'
@debian_package_ensure = '3.0.14'
print "operatingsystemmajrelease := #{operatingsystemmajrelease}"

if operatingsystemmajrelease == '6'
@redhat_package_ensure = '3.0.9-1'
@cassandra_optutils_package = 'cassandra30-tools'
@cassandra_package = 'cassandra30'
else
@redhat_release = '30x'
@redhat_package_ensure = '3.0.14-1'
@cassandra_optutils_package = 'cassandra-tools'
@cassandra_package = 'cassandra'
end
end

def bootstrap_pp
Expand All @@ -53,7 +62,7 @@ def bootstrap_pp
logoutput => true,
}
notify { "${::operatingsystem}-${::operatingsystemmajrelease}": }
notify { "${::hostname}:${::operatingsystem}-${::operatingsystemmajrelease}": }
file { '/etc/dse':
ensure => directory,
Expand Down Expand Up @@ -121,9 +130,20 @@ class { 'cassandra::apache_repo':
$cassandra_package = 'cassandra'
$cassandra_optutils_package = 'cassandra-tools'
} else {
class { 'cassandra::datastax_repo':
before => Class['cassandra', 'cassandra::optutils'],
if #{@version} >= 3.0 and $::operatingsystemmajrelease >= 7 {
yumrepo { 'datastax':
ensure => absent,
} ->
class { 'cassandra::apache_repo':
release => '#{@redhat_release}',
before => Class['cassandra', 'cassandra::optutils'],
}
} else {
class { 'cassandra::datastax_repo':
before => Class['cassandra', 'cassandra::optutils'],
}
}
$package_ensure = '#{@redhat_package_ensure}'
$cassandra_package = '#{@cassandra_package}'
$cassandra_optutils_package = '#{@cassandra_optutils_package}'
Expand Down

0 comments on commit 40f8045

Please sign in to comment.