-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reworking the management of the jre installation
- Loading branch information
1 parent
7019c71
commit 5b304fe
Showing
16 changed files
with
170 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ spec/fixtures/ | |
coverage/ | ||
*.iml | ||
.idea/ | ||
log/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,5 @@ end | |
group :system_tests do | ||
gem "beaker" | ||
gem "beaker-rspec" | ||
gem "vagrant-wrapper" | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# == Class: rundeck::facts | ||
# | ||
# Class to add some facts for rundeck. They have been added as an external fact | ||
# because we do not want to distrubute these facts to all systems. | ||
# | ||
# === Parameters | ||
# | ||
# [*ensure*] - ensure that these facts are added to the system | ||
# | ||
# === Examples | ||
# | ||
# class { 'rundeck::facts': } | ||
# | ||
class rundeck::facts( | ||
$ensure = 'present', | ||
) { | ||
|
||
if $::puppetversion =~ /Puppet Enterprise/ { | ||
$ruby_bin = '/opt/puppet/bin/ruby' | ||
$dir = 'puppetlabs/' | ||
} else { | ||
$ruby_bin = '/usr/bin/env ruby' | ||
$dir = '' | ||
} | ||
|
||
if ! defined(File["/etc/${dir}facter"]) { | ||
file { "/etc/${dir}facter": | ||
ensure => directory, | ||
} | ||
} | ||
if ! defined(File["/etc/${dir}facter/facts.d"]) { | ||
file { "/etc/${dir}facter/facts.d": | ||
ensure => directory, | ||
} | ||
} | ||
|
||
file { "/etc/${dir}facter/facts.d/rundeck_facts.rb": | ||
ensure => $ensure, | ||
content => template('rundeck/facts.rb.erb'), | ||
mode => '0500', | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'rundeck class' do | ||
|
||
context 'older package version', :if => fact('osfamily').eql?('Debian') do | ||
it 'should work with no errors' do | ||
|
||
puppet('resource', 'package', 'rundeck', 'ensure=absent') | ||
puppet('resource', 'file', '/var/lib/rundeck', 'ensure=absent') | ||
|
||
pp = <<-EOS | ||
class { 'rundeck': | ||
package_ensure => '2.0.0-1-GA' | ||
} | ||
EOS | ||
|
||
# Run it twice and test for idempotency | ||
expect(apply_manifest(pp).exit_code).to_not eq(1) | ||
expect(apply_manifest(pp).exit_code).to eq(0) | ||
end | ||
|
||
describe package('openjdk-6-jre') do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('rundeck') do | ||
it { should be_installed.with_version('2.0.0') } | ||
end | ||
|
||
describe service('rundeckd') do | ||
it { should be_running } | ||
end | ||
end | ||
|
||
context 'older package version', :if => fact('osfamily').eql?('RedHat') do | ||
it 'should work with no errors' do | ||
|
||
puppet('resource', 'package', 'rundeck', 'ensure=absent') | ||
|
||
pp = <<-EOS | ||
class { 'rundeck': | ||
package_ensure => '2.0.0-1.8.GA' | ||
} | ||
EOS | ||
|
||
# Run it twice and test for idempotency | ||
expect(apply_manifest(pp).exit_code).to_not eq(1) | ||
expect(apply_manifest(pp).exit_code).to eq(0) | ||
end | ||
|
||
describe package('java-1.6.0-openjdk') do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('rundeck') do | ||
it { should be_installed.with_version('2.0.0') } | ||
end | ||
|
||
describe service('rundeckd') do | ||
it { should be_running } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
require 'puppetlabs_spec_helper/module_spec_helper' | ||
|
||
RSpec.configure do |c| | ||
c.default_facts = { | ||
:puppetversion => '3.7.4', | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!<%= @ruby_bin %> | ||
# Fact: rundeck_version | ||
# | ||
# Purpose: Return facts for the running version of rundeck. | ||
# | ||
|
||
if File.exists?('/etc/debian_version') | ||
version = %["dpkg-query -W -f 'rundeck_version=${Version}\n' rundeck"] | ||
puts version | ||
elsif File.exists?('/etc/redhat-release') or File.exists?('/etc/centos-release') | ||
version = %["rpm -q --qf 'rundeck_version=%{VERSION}\n' rundeck"] | ||
puts version | ||
end |