Skip to content

Commit

Permalink
Release 2.3.0 (voxpupuli#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
dallinb authored Jan 21, 2017
1 parent 6f6451c commit fb0402c
Show file tree
Hide file tree
Showing 47 changed files with 728 additions and 384 deletions.
20 changes: 10 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
.bundle/
coverage/
doc/
Gemfile.lock
.idea/
.project
.travis/secrets.tar
.vagrant/
.yardoc/
*.iml
.librarian/
log/
pkg/
.project
Puppetfile.lock
spec/fixtures/
*.swn
*.swo
*.swp
Gemfile.lock
coverage/
doc/
pkg/
spec/fixtures/
vendor/
log/
.yardoc/
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
Metrics/BlockLength:
Enabled: false
Metrics/LineLength:
Enabled: false
Style/FrozenStringLiteralComment:
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ script:
- "bundle exec rake lint"
- "bundle exec rake validate"
- "bundle exec rake spec SPEC_OPTS='--format documentation'"
- "bundle exec rake acceptance"
- travis_wait 40 "bundle exec rake acceptance"
notifications:
email: false
matrix:
fast_finish: true
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Change Log for Puppet Module locp-cassandra

##2017-01-21 - Release 2.3.0 ([diff](https://github.com/locp/cassandra/compare/2.2.1...2.3.0))

New attribute to `::cassandra` class:

* `baseline_settings`

New defined types:

* `cassandra::system::swapoff`
* `cassandra::system::sysctl`
* `cassandra::system::transparent_hugepage`

##2016-12-08 - Release 2.2.1 ([diff](https://github.com/locp/cassandra/compare/2.2.0...2.2.1))

### Summary
Expand Down
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.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)
2.0.0 | [Convert cassandra::file from a class to a define](https://github.com/locp/cassandra/issues/266)| [@stanleyz](https://github.com/stanleyz)
Expand Down
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ group :test do
end

group :acceptance do
gem 'beaker', require: false
gem 'beaker-puppet_install_helper', require: false
gem 'beaker-rspec', require: false
gem 'pry', require: false
gem 'beaker'
gem 'beaker-puppet_install_helper'
gem 'beaker-rspec'
gem 'pry'
end

group :development do
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2015, 2016 League of Crafty Programmers Ltd.
Copyright 2015 - 2017 League of Crafty Programmers Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
39 changes: 36 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,32 @@ class { 'cassandra':
}
```

### Hiera

In your top level node classification (usually `common.yaml`), add the
settings hash and all the tweaks you want all the clusters to use:

```YAML
cassandra::baseline_settings:
authenticator: AllowAllAuthenticator
authorizer: AllowAllAuthorizer
auto_bootstrap: true
auto_snapshot: true
...
```

Then, in the individual node classification add the parts which define
the cluster:

```YAML
cassandra::settings:
cluster_name: developer playground cassandra cluster
cassandra::dc: Onsite1
cassandra::rack: RAC1
cassandra::package_ensure: 3.0.5-1
cassandra::package_name: cassandra30
```
## Usage
### Setup a keyspace and users
Expand Down Expand Up @@ -529,6 +555,12 @@ true or not set the attribute at all after initializing the cluster.
(http://locp.github.io/cassandra/puppet_classes/cassandra_3A_3Aoptutils.html)
* [cassandra::schema]
(http://locp.github.io/cassandra/puppet_classes/cassandra_3A_3Aschema.html)
* [cassandra::system::swapoff]
(http://locp.github.io/cassandra/puppet_classes/cassandra_3A_3Asystem_3A_3Aswapoff.html)
* [cassandra::system::sysctl]
(http://locp.github.io/cassandra/puppet_classes/cassandra_3A_3Asystem_3A_3Asysctl.html)
* [cassandra::system::transparent_hugepage]
(http://locp.github.io/cassandra/puppet_classes/cassandra_3A_3Asystem_3A_3Atransparent_hugepage.html)

### Public Defined Types

Expand Down Expand Up @@ -573,14 +605,15 @@ true or not set the attribute at all after initializing the cluster.

## Limitations

When using a Ruby version before 1.9.0, the contents of the Cassandra
* When using a Ruby version before 1.9.0, the contents of the Cassandra
configuration file may change order of elements due to a problem with
to_yaml in earlier versions of Ruby.

When creating key spaces, indexes, cql_types and users the settings will only
* When creating key spaces, indexes, cql_types and users the settings will only
be used to create a new resource if it does not currently exist. If a change
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.

## Development

Expand Down
187 changes: 46 additions & 141 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,146 +1,51 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'json'

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'.freeze

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.

# Every Vagrant virtual environment requires a box to build off of.
config.vm.hostname = 'node0'
config.vm.box = 'puppetlabs/centos-7.0-64-nocm'
# config.vm.box = 'puppetlabs/ubuntu-14.04-64-nocm'
config.puppet_install.puppet_version = '3.8.2'
config.vm.synced_folder '.', '/etc/puppet/modules/cassandra'

# Enable provisioning with Puppet stand alone. Puppet manifests
# are contained in a directory path relative to this Vagrantfile.
# You will need to create the manifests directory and a manifest in
# the file default.pp in the manifests_path directory.
#
# generate list of puppet modules to be installed from metadata.json
metadata_json_file = "#{File.dirname(__FILE__)}/metadata.json"
if File.exist?(metadata_json_file)
JSON.parse(File.read(metadata_json_file))['dependencies'].each do |key, _value|
module_name = key['name'].to_s
config.vm.provision 'shell',
inline: "puppet module install #{module_name}"
end
else
puts 'metadata.json not found; skipping install of dependencies'
# TODO: Find out why cassandra::params not working with vagrant and CentOS 6.2
# TODO: Find out why cassandra::params not working with vagrant and CentOS 7.0
# TODO: Find out why cassandra::params not working with vagrant and Ubuntu 12.04.
# TODO: Have vagrant dynamically discover Puppet modules from metadata.json.
Vagrant.configure('2') do |config|
# config.vm.box = 'puppetlabs/centos-6.6-64-puppet'
# config.vm.box = 'puppetlabs/centos-7.0-64-puppet'
config.vm.box = 'puppetlabs/debian-7.8-64-puppet'
# config.vm.box = 'puppetlabs/debian-8.2-64-puppet'
# config.vm.box = "puppetlabs/ubuntu-12.04-64-puppet"
# config.vm.box = "puppetlabs/ubuntu-14.04-64-puppet"
# config.vm.box = "puppetlabs/ubuntu-16.04-64-puppet"

config.vm.provider 'virtualbox' do |vm|
vm.memory = 2048
vm.cpus = 2
end

config.vm.provision 'puppet' do |puppet|
puppet.manifests_path = 'examples'
puppet.manifest_file = 'getting_started.pp'
puppet_environment = 'vagrant'
puppet_environment_path_on_guest = "/etc/puppetlabs/code/environments/#{puppet_environment}"
module_path_on_guest = "#{puppet_environment_path_on_guest}/modules"

config.vm.synced_folder './vagrant',
'/etc/puppetlabs/code/environments/vagrant'
config.vm.synced_folder '.',
'/etc/puppetlabs/code/environments/vagrant/modules/cassandra'
config.vm.synced_folder './spec/acceptance/hieradata',
'/etc/puppetlabs/code/environments/vagrant/hieradata'

config.vm.provision :shell, inline: "test -d #{module_path_on_guest}/ || mkdir #{puppet_environment_path_on_guest}"
config.vm.provision :shell, inline: "test -d #{module_path_on_guest}/apt || puppet module install puppetlabs-apt --environment=#{puppet_environment}"
config.vm.provision :shell, inline: "test -d #{module_path_on_guest}/firewall || puppet module install puppetlabs-firewall --environment=#{puppet_environment}"
config.vm.provision :shell, inline: "test -d #{module_path_on_guest}/inifile || puppet module install puppetlabs-inifile --environment=#{puppet_environment}"
config.vm.provision :shell, inline: "test -d #{module_path_on_guest}/stdlib || puppet module install puppetlabs-stdlib --environment=#{puppet_environment}"

config.vm.provision :puppet do |puppet|
puppet.options = ENV['PUPPET_OPTS'].split(' ') if ENV.key?('PUPPET_OPTS') # See http://stackoverflow.com/a/27540417/224334
puppet.options = '--verbose --debug' if ENV['PUPPET_VERBOSE']
puppet.hiera_config_path = 'vagrant/hiera.yaml'
puppet.environment = puppet_environment
puppet.environment_path = './'
puppet.manifests_path = "#{puppet_environment}/manifests"
puppet.manifest_file = 'site.pp'
puppet.facter = {
project_name: 'ENGLISH NAME Of PROJECT', # EDIT THIS LINE
}
end

# Have something like the following in puppet/manifests/local.pp:
# node default {
# require '::base'
# include '::foobar'
# }
#
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network 'forwarded_port', guest: 8888, host: 8888

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
# config.ssh.forward_agent = true

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider 'virtualbox' do |vb|
# Don't boot with headless mode
# vb.gui = true

# Use VBoxManage to customize the VM. For example to change memory:
vb.customize ['modifyvm', :id, '--memory', '2048']
end
#
# View the documentation for the provider you're using for more
# information on available options.

# Enable provisioning with CFEngine. CFEngine Community packages are
# automatically installed. For example, configure the host as a
# policy server and optionally a policy file to run:
#
# config.vm.provision "cfengine" do |cf|
# cf.am_policy_hub = true
# # cf.run_file = "motd.cf"
# end
#
# You can also configure and bootstrap a client to an existing
# policy server:
#
# config.vm.provision "cfengine" do |cf|
# cf.policy_server_address = "10.0.2.15"
# end

# Enable provisioning with chef solo, specifying a cookbooks path, roles
# path, and data_bags path (all relative to this Vagrantfile), and adding
# some recipes and/or roles.
#
# config.vm.provision "chef_solo" do |chef|
# chef.cookbooks_path = "../my-recipes/cookbooks"
# chef.roles_path = "../my-recipes/roles"
# chef.data_bags_path = "../my-recipes/data_bags"
# chef.add_recipe "mysql"
# chef.add_role "web"
#
# # You may also specify custom JSON attributes:
# chef.json = { mysql_password: "foo" }
# end

# Enable provisioning with chef server, specifying the chef server URL,
# and the path to the validation key (relative to this Vagrantfile).
#
# The Opscode Platform uses HTTPS. Substitute your organization for
# ORGNAME in the URL and validation key.
#
# If you have your own Chef Server, use the appropriate URL, which may be
# HTTP instead of HTTPS depending on your configuration. Also change the
# validation key to validation.pem.
#
# config.vm.provision "chef_client" do |chef|
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
# chef.validation_key_path = "ORGNAME-validator.pem"
# end
#
# If you're using the Opscode platform, your validator client is
# ORGNAME-validator, replacing ORGNAME with your organization name.
#
# If you have your own Chef Server, the default validation client name is
# chef-validator, unless you changed the configuration.
#
# chef.validation_client_name = "ORGNAME-validator"
config.vm.network :forwarded_port, guest: 22, host: 2223, auto_correct: true, id: 'ssh'
config.vm.network :forwarded_port, guest: 3000, host: 3000
end
4 changes: 1 addition & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ machine:
PUPPET_VERSION: '~> 3.8'
STRICT_VARIABLES: yes
ruby:
version: 2.1.6
services:
- docker
version: 2.1.9
notify:
webhooks:
-
Expand Down
13 changes: 10 additions & 3 deletions examples/getting_started.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@
#############################################################################

# Cassandra pre-requisites
include cassandra::datastax_repo
include cassandra::java
require cassandra::datastax_repo
require cassandra::system::sysctl
require cassandra::system::transparent_hugepage
require cassandra::java

class { 'cassandra::system::swapoff':
device => '/dev/mapper/centos-swap',
before => Class['cassandra'],
}

# Create a cluster called MyCassandraCluster which uses the
# GossipingPropertyFileSnitch. In this very basic example
Expand Down Expand Up @@ -43,7 +50,7 @@
'start_native_transport' => true,
},
service_ensure => running,
require => Class['cassandra::datastax_repo', 'cassandra::java'],
require => Class['cassandra::datastax_repo', 'cassandra::system::sysctl', 'cassandra::java'],
}

class { 'cassandra::datastax_agent':
Expand Down
Loading

0 comments on commit fb0402c

Please sign in to comment.