6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Release notes for the puppetlabs-java_ks module

---------------------------------------

2014-02-12 Release 1.2.1
========================

### Bugfixes
- Updating specs

2013-09-18 Release 1.2.0
========================

Expand Down
9 changes: 5 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
source "https://rubygems.org"
source ENV['GEM_SOURCE'] || "https://rubygems.org"

group :development, :test do
gem 'rake'
gem 'rspec', :require => false
gem 'mocha', :require => false
gem 'puppet-lint', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-system', :require => false
gem 'rspec-system-puppet', :require => false
gem 'rspec-system-serverspec', :require => false
gem 'beaker', :require => false
gem 'beaker-rspec', :require => false
gem 'serverspec', :require => false
end

if puppetversion = ENV['PUPPET_GEM_VERSION']
Expand Down
2 changes: 1 addition & 1 deletion Modulefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name 'puppetlabs-java_ks'
version '1.2.0'
version '1.2.1'

author 'puppetlabs'
license 'ASL 2.0'
Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'rspec-system/rake_task'
11 changes: 11 additions & 0 deletions spec/acceptance/basic_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'spec_helper_acceptance'

describe 'prep nodes' do
it 'requires java' do
pp = <<-EOS
class { 'java': }
EOS

apply_manifest(pp, :catch_failures => true)
end
end
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
require 'spec_helper_system'
require 'spec_helper_acceptance'

describe 'managing java keystores' do
it 'creates a keystore' do
puppet_apply(%{
pp = <<-EOS
class { 'java': }
java_ks { 'puppetca:keystore':
ensure => latest,
certificate => '/var/lib/puppet/ssl/certs/ca.pem',
certificate => '/etc/puppet/ssl/certs/ca.pem',
target => '/etc/keystore.ks',
password => 'puppet',
trustcacerts => true,
}
}) { |r| [0,2].should include r.exit_code}
EOS

apply_manifest(pp, :catch_failures => true)
end

it 'verifies the keystore' do
Expand Down
10 changes: 10 additions & 0 deletions spec/acceptance/nodesets/centos-510-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
centos-510-x64.local:
roles:
- master
platform: el-5-x86_64
box : centos-510-x64-virtualbox-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-510-x64-virtualbox-nocm.box
hypervisor : vagrant
CONFIG:
type: git
10 changes: 10 additions & 0 deletions spec/acceptance/nodesets/centos-59-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
centos-59-x64.local:
roles:
- master
platform: el-5-x86_64
box : centos-59-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: git
12 changes: 12 additions & 0 deletions spec/acceptance/nodesets/centos-64-x64-pe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
HOSTS:
centos-64-x64.local:
roles:
- master
- database
- dashboard
platform: el-6-x86_64
box : centos-64-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: pe
10 changes: 10 additions & 0 deletions spec/acceptance/nodesets/centos-64-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
centos-64-x64.local:
roles:
- master
platform: el-6-x86_64
box : centos-64-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: git
10 changes: 10 additions & 0 deletions spec/acceptance/nodesets/debian-607-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
debian-607-x64.local:
roles:
- master
platform: debian-6-amd64
box : debian-607-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: git
10 changes: 10 additions & 0 deletions spec/acceptance/nodesets/debian-73-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
debian-73-x64.local:
roles:
- master
platform: debian-7-amd64
box : debian-73-x64-virtualbox-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box
hypervisor : vagrant
CONFIG:
type: git
1 change: 1 addition & 0 deletions spec/acceptance/nodesets/default.yml
10 changes: 10 additions & 0 deletions spec/acceptance/nodesets/ubuntu-server-10044-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
ubuntu-server-10044-x64.local:
roles:
- master
platform: ubuntu-10.04-amd64
box : ubuntu-server-10044-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: git
10 changes: 10 additions & 0 deletions spec/acceptance/nodesets/ubuntu-server-12042-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
ubuntu-server-12042-x64.local:
roles:
- master
platform: ubuntu-12.04-amd64
box : ubuntu-server-12042-x64-vbox4210-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
hypervisor : vagrant
CONFIG:
type: git
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
require 'spec_helper_system'
require 'spec_helper_acceptance'

hostname = default.node_name

describe 'managing java private keys' do
it 'creates a private key' do
puppet_apply(%{
pp = <<-EOS
class { 'java': }
java_ks { 'broker.example.com:/etc/private_key.ks':
ensure => latest,
certificate => '/var/lib/puppet/ssl/certs/main.foo.vm.pem',
private_key => '/var/lib/puppet/ssl/private_keys/main.foo.vm.pem',
certificate => "/etc/puppet/ssl/certs/#{hostname}.pem",
private_key => "/etc/puppet/ssl/private_keys/#{hostname}.pem",
password => 'puppet',
}
}) { |r| [0,2].should include r.exit_code}
EOS

apply_manifest(pp, :catch_failures => true)
end

it 'verifies the private key' do
Expand All @@ -23,7 +28,8 @@

describe 'from a puppet:// uri' do
it 'puts a key in a module' do
puppet_apply(%{
pp = <<-EOS
class { 'java': }
file { [
'/etc/puppet/modules/keys',
'/etc/puppet/modules/keys/files',
Expand All @@ -32,29 +38,34 @@
}
file { '/etc/puppet/modules/keys/files/ca.pem':
ensure => file,
source => '/var/lib/puppet/ssl/certs/ca.pem',
source => '/etc/puppet/ssl/certs/ca.pem',
}
file { '/etc/puppet/modules/keys/files/certificate.pem':
ensure => file,
source => '/var/lib/puppet/ssl/certs/main.foo.vm.pem',
source => '/etc/puppet/ssl/certs/#{hostname}.pem',
}
file { '/etc/puppet/modules/keys/files/private_key.pem':
ensure => file,
source => '/var/lib/puppet/ssl/private_keys/main.foo.vm.pem',
source => '/etc/puppet/ssl/private_keys/#{hostname}.pem',
}
}) { |r| [0,2].should include r.exit_code}
EOS

apply_manifest(pp, :catch_failures => true)
end

it 'creates a keystore' do
puppet_apply(%{
pp = <<-EOS
class { 'java': }
java_ks { 'uri.example.com:/etc/uri_key.ks':
ensure => latest,
certificate => 'puppet:///modules/keys/certificate.pem',
private_key => 'puppet:///modules/keys/private_key.pem',
chain => 'puppet:///modules/keys/ca.pem',
password => 'puppet',
}
}) { |r| [0,2].should include r.exit_code}
EOS

apply_manifest(pp, :catch_failures => true)
end

it 'verifies the private key' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
require 'spec_helper_system'
require 'spec_helper_acceptance'

describe 'managing java truststores' do
it 'creates a truststore' do
puppet_apply(%{
pp = <<-EOS
class { 'java': }
java_ks { 'puppetca:truststore':
ensure => latest,
certificate => '/var/lib/puppet/ssl/certs/ca.pem',
certificate => '/etc/puppet/ssl/certs/ca.pem',
target => '/etc/truststore.ts',
password => 'puppet',
trustcacerts => true,
}
}) { |r| [0,2].should include r.exit_code}
}
EOS
apply_manifest(pp, :catch_failures => true)
end

it 'verifies the truststore' do
Expand Down
36 changes: 36 additions & 0 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'

hosts.each do |host|
if host['platform'] =~ /debian/
on host, 'echo \'export PATH=/var/lib/gems/1.8/bin/:${PATH}\' >> ~/.bashrc'
end
if host.is_pe?
install_pe
else
# Install Puppet
install_package host, 'rubygems'
on host, 'gem install puppet --no-ri --no-rdoc'
on host, "mkdir -p #{host['distmoduledir']}"
# Create certs for keystore tests.
on host, 'puppet master --no-daemonize --verbose &'
#on host, 'killall -9 puppet'
end
end

RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))

# Readable test descriptions
c.formatter = :documentation

# Configure all nodes in nodeset
c.before :suite do
# Install module and dependencies
puppet_module_install(:source => proj_root, :module_name => 'java_ks')
hosts.each do |host|
shell('puppet module install puppetlabs-java --version 1.0.1')
end
end
end
9 changes: 0 additions & 9 deletions spec/system/basic_spec.rb

This file was deleted.

File renamed without changes.