Showing with 51 additions and 28 deletions.
  1. +0 −7 .travis.yml
  2. +10 −0 CHANGELOG.md
  3. +4 −4 README.md
  4. +2 −2 manifests/service.pp
  5. +1 −1 metadata.json
  6. +9 −9 spec/acceptance/class_spec.rb
  7. +19 −0 spec/defines/service_spec.rb
  8. +6 −5 spec/spec_helper_acceptance.rb
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,13 @@ language: ruby
bundler_args: --without development
script: "bundle exec rake spec SPEC_OPTS='--format documentation'"
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
env:
matrix:
- PUPPET_GEM_VERSION="~> 2.7.0"
- PUPPET_GEM_VERSION="~> 3.3.0"
- PUPPET_GEM_VERSION="~> 3.4.0"
matrix:
fast_finish: true
exclude:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 2.7.0"
notifications:
email: false
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
##2014-08-14 - Release 0.1.1
###Summary

This is a bugfix release.

###Bugfixes
- Update 'warn' to correct 'warning' function.
- Update README for use_init.
- Test updates and fixes.

##2014-08-06 - Release 0.1.0
###Summary

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ Specifies the base directory for the Tomcat installation.
#####`$use_jsvc`

Specifies whether or not to use Jsvc for service management. A Boolean that defaults to 'false'. If both `$use_jsvc` and `$use_init` are false,
`$CATALINA_BASE/bin/catalina.sh start` and `$CATALIN/A_BASE/bin/catalina.sh stop` are used for service management.
`$CATALINA_BASE/bin/catalina.sh start` and `$CATALINA_BASE/bin/catalina.sh stop` are used for service management.

#####`$java_home`

Expand All @@ -437,8 +437,8 @@ Determines whether the Tomcat service is on or off. (To determine whether the se

#####`$use_init`

Specifies whether or not to use init.pp for service management. A Boolean that defaults to 'false'. If both `$use_jsvc` and `$use_init` are false,
`$CATALINA_BASE/bin/catalina.sh start` and `$CATALIN/A_BASE/bin/catalina.sh stop` are used for service management.
Specifies whether or not to use the package-provided init script for service management. A Boolean that defaults to 'false'. If both `$use_jsvc` and `$use_init` are false,
`$CATALINA_BASE/bin/catalina.sh start` and `$CATALINA_BASE/bin/catalina.sh stop` are used for service management.

#####`$service_name`

Expand Down Expand Up @@ -524,4 +524,4 @@ Quickstart:
bundle install
bundle exec rake spec
bundle exec rspec spec/acceptance
RS_DEBUG=yes bundle exec rspec spec/acceptance
RS_DEBUG=yes bundle exec rspec spec/acceptance
4 changes: 2 additions & 2 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
}

if $java_home and ! $use_jsvc {
warn('$java_home has no affect unless $use_jsvc = true')
warning('$java_home has no affect unless $use_jsvc = true')
}

if $java_home and $start_command {
warn('$java_home is used in the $start_command, so this may not work as planned')
warning('$java_home is used in the $start_command, so this may not work as planned')
}

if $use_jsvc {
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-tomcat",
"version": "0.1.0",
"version": "0.1.1",
"author": "puppetlabs",
"summary": "Puppet module for managing Apache Tomcat.",
"license": "Apache 2.0",
Expand Down
18 changes: 9 additions & 9 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
class { 'tomcat': }
class { 'java': }
if $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '10.04' {
if ($::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '10.04') or ($::osfamily == 'RedHat' and $::operatingsystemmajrelease == '5') {
tomcat::instance { 'tomcat7-default':
catalina_base => '/opt/apache-tomcat/tomcat7-default',
source_url => 'http://www.carfab.com/apachesoftware/tomcat/tomcat-7/v7.0.54/bin/apache-tomcat-7.0.54.tar.gz'
source_url => 'http://www.dsgnwrld.com/am/tomcat/tomcat-7/v7.0.55/bin/apache-tomcat-7.0.55.tar.gz'
}->
tomcat::config::server::connector { 'tomcat7-default-http':
catalina_base => '/opt/apache-tomcat/tomcat7-default',
Expand Down Expand Up @@ -77,7 +77,7 @@ class { 'java': }
}
tomcat::instance { 'tomcat7':
source_url => 'http://www.carfab.com/apachesoftware/tomcat/tomcat-7/v7.0.54/bin/apache-tomcat-7.0.54.tar.gz',
source_url => 'http://www.dsgnwrld.com/am/tomcat/tomcat-7/v7.0.55/bin/apache-tomcat-7.0.55.tar.gz',
catalina_base => '/opt/apache-tomcat/tomcat7',
}->
tomcat::config::server { 'tomcat7':
Expand Down Expand Up @@ -151,7 +151,7 @@ class { 'java': }
class { 'tomcat': }
class { 'java': }
if $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '10.04' {
if ($::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '10.04') or ($::osfamily == 'RedHat' and $::operatingsystemmajrelease == '5') {
tomcat::service { 'default':
catalina_base => '/opt/apache-tomcat/tomcat7-default',
service_ensure => stopped,
Expand Down Expand Up @@ -242,7 +242,7 @@ class { 'java': }
r.stdout.should match(/HTTP Status 404/)
end
end
it 'should be able to run with jsvc on port below 1024', :unless => (fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') == '10.04') do
it 'should be able to run with jsvc on port below 1024', :unless => ((fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') == '10.04') or (fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') == '5')) do
pp = <<-EOS
class { 'tomcat': }
class { 'gcc': }
Expand Down Expand Up @@ -325,22 +325,22 @@ class { 'java': }
#give tomcat time to start up
shell("sleep 10")
end
it 'should have deployed the sample JSP on 8082', :unless => (fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') == '10.04') do
it 'should have deployed the sample JSP on 8082', :unless => ((fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') == '10.04') or (fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') == '5')) do
shell("/usr/bin/curl localhost:8082/sample/hello.jsp", {:acceptable_exit_codes => 0}) do |r|
r.stdout.should match(/Sample Application JSP Page/)
end
end
it 'should have deployed the sample servlet on 8082', :unless => (fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') == '10.04') do
it 'should have deployed the sample servlet on 8082', :unless => ((fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') == '10.04') or (fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') == '5')) do
shell("/usr/bin/curl localhost:8082/sample/hello", {:acceptable_exit_codes => 0}) do |r|
r.stdout.should match(/Sample Application Servlet Page/)
end
end
it 'should have deployed the sample JSP on 80', :unless => (fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') == '10.04') do
it 'should have deployed the sample JSP on 80', :unless => ((fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') == '10.04') or (fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') == '5')) do
shell("/usr/bin/curl localhost:80/sample/hello.jsp", {:acceptable_exit_codes => 0}) do |r|
r.stdout.should match(/Sample Application JSP Page/)
end
end
it 'should have deployed the sample servlet on 80', :unless => (fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') == '10.04') do
it 'should have deployed the sample servlet on 80', :unless => ((fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') == '10.04') or (fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') == '5')) do
shell("/usr/bin/curl localhost:80/sample/hello", {:acceptable_exit_codes => 0}) do |r|
r.stdout.should match(/Sample Application Servlet Page/)
end
Expand Down
19 changes: 19 additions & 0 deletions spec/defines/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,24 @@
}.to raise_error(Puppet::Error, /\$service_name must be specified/)
end
end
context "java_home without use_jsvc warning" do
let :params do
{
:java_home => 'foo',
}
end

it { is_expected.to compile }
end
context "java_home with start_command" do
let :params do
{
:java_home => 'foo',
:start_command => '/bin/true'
}
end

it { is_expected.to compile }
end
end
end
11 changes: 6 additions & 5 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@


unless ENV['RS_PROVISION'] == 'no'
if default.is_pe?
install_pe
else
install_puppet
end

hosts.each do |host|
if host.is_pe?
install_pe
else
install_puppet
on host, "mkdir -p #{host['distmoduledir']}"
end
end
end

Expand Down