Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

joshbeard updates #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
fixtures:
repositories:
stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
wget: "git://github.com/maestrodev/puppet-wget.git"
deploy: "git://github.com/mkrakowitzer/puppet-deploy.git"
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
staging: "https://github.com/nanliu/puppet-staging"
symlinks:
crowd: "#{source_dir}"
crowd: "#{source_dir}"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.bundle
.bundler
.tmp
.idea
.swp
Gemfile.lock
spec/fixtures
5 changes: 5 additions & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--fail-on-warnings
--with-filename
--no-80chars-check
--no-documentation-check
--no-class_inherits_from_params_class-check
63 changes: 36 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
---
branches:
only:
- master
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.0.0"
- PUPPET_GEM_VERSION="~> 3.1.0"
- PUPPET_GEM_VERSION="~> 3.2.0"
sudo: false
bundler_args: --without system_tests
script:
- "bundle exec puppet --version"
- "bundle exec rake validate"
- "bundle exec rake lint"
- "bundle exec rake spec SPEC_OPTS='--color --format documentation'"
- '[ "$PUPPET_GEM_VERSION" == ">= 3.7.0" ] && bundle exec rake future || exit 0'
matrix:
exclude:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.1.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.2.0"
fast_finish: true
allow_failures:
- env: PUPPET_GEM_VERSION="~> 4.0" ORDERING="random" STRICT_VARIABLES="yes"
- env: PUPPET_GEM_VERSION="~> 3.0" ORDERING="random" STRICT_VARIABLES="yes" FUTURE_PARSER="yes"
include:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.0" ORDERING="random"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.0" ORDERING="random" STRICT_VARIABLES="yes" FUTURE_PARSER="yes"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0" ORDERING="random"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0" ORDERING="random" STRICT_VARIABLES="yes" FUTURE_PARSER="yes"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0" ORDERING="random"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0" ORDERING="random" STRICT_VARIABLES="yes" FUTURE_PARSER="yes"
- rvm: 2.1
env: PUPPET_GEM_VERSION="~> 3.0" ORDERING="random"
- rvm: 2.1
env: PUPPET_GEM_VERSION="~> 3.0" ORDERING="random" STRICT_VARIABLES="yes" FUTURE_PARSER="yes"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 4.0" ORDERING="random" STRICT_VARIABLES="yes"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 4.0" ORDERING="random" STRICT_VARIABLES="yes"
- rvm: 2.1
env: PUPPET_GEM_VERSION="~> 4.0" ORDERING="random" STRICT_VARIABLES="yes"
notifications:
email: false
email: false
5 changes: 5 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Calum Lacroix, [email protected]
Josh Beard, [email protected]
Josh Beard, [email protected]
Martin Jackson, [email protected]
Victor J. C. Geyer, [email protected]
63 changes: 51 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,51 @@
source 'https://rubygems.org'
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7']

gem 'puppet', puppetversion

group :test do
gem 'rake', '>= 0.9.0'
gem 'rspec', '>= 2.8.0'
gem 'rspec-puppet', '>= 0.1.1'
gem 'puppetlabs_spec_helper', '>= 0.4.1'
gem 'puppet-lint'
end
source ENV['GEM_SOURCE'] || "https://rubygems.org"

def location_for(place, fake_version = nil)
if place =~ /^(git:[^#]*)#(.*)/
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
elsif place =~ /^file:\/\/(.*)/
['>= 0', { :path => File.expand_path($1), :require => false }]
else
[place, { :require => false }]
end
end

group :development, :unit_tests do
gem 'rake', :require => false
gem 'rspec-core', '3.1.7', :require => false
gem 'rspec-puppet', '~> 2.1', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', :require => false
gem 'simplecov', :require => false
gem 'puppet_facts', :require => false
gem 'json', :require => false
gem 'metadata-json-lint', :require => false
end

beaker_version = ENV['BEAKER_VERSION']
beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
group :system_tests do
if beaker_version
gem 'beaker', *location_for(beaker_version)
end
if beaker_rspec_version
gem 'beaker-rspec', *location_for(beaker_rspec_version)
else
gem 'beaker-rspec', :require => false
end
gem 'serverspec', :require => false
end

if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion, :require => false
else
gem 'facter', :require => false
end

if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end

# vim:ft=ruby
13 changes: 0 additions & 13 deletions Modulefile

This file was deleted.

16 changes: 10 additions & 6 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Atlassian Crowd Puppet Module

[![Build Status](https://travis-ci.org/actionjack/puppet-crowd.png?branch=master)](https://travis-ci.org/actionjack/puppet-crowd)
[![Build Status](https://travis-ci.org/joshbeard/puppet-crowd.png?branch=master)](https://travis-ci.org/joshbeard/puppet-crowd)

This puppet module is used to install and configure the crowd application.
Atlassian Crowd is a Single Sign-On (SSO) and Identity Management service.
https://www.atlassian.com/software/crowd/overview

Forked from [https://github.com/actionjack/puppet-crowd](https://github.com/actionjack/puppet-crowd)

* * *

## Configuration
Expand All @@ -16,8 +18,7 @@
Current dependencies are:

* puppetlabs/stdlib
* mkrakowitzer/deploy
* maestrodev/wget
* nanliu/staging or puppetcommunity/staging

## Usage

Expand All @@ -27,23 +28,26 @@ class {'crowd': }

## Documentation

This module is written in puppetdoc compliant format so details on configuration and usage can be found by executing:
This module is written in puppetdoc compliant format so details on
configuration and usage can be found by executing:

```bash
$ puppet doc manifest/init.pp
```

## Pull Requests

* Please submit a pull request or issue on [GitHub](https://github.com/actionjack/puppet-crowd)
* Please submit a pull request or issue on
[GitHub](https://github.com/joshbeard/puppet-crowd)

##Limitations
## Limitations

This module has been built on and tested against Puppet 2.7 and higher.

The module has been tested on:

* Ubuntu 12.04
* EL 6

The module has been tested against the following database(s):

Expand Down
86 changes: 83 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,86 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet-lint/tasks/puppet-lint'

PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
repo_dir = File.dirname(__FILE__)

ignore_paths = [
'pkg/**/*.pp',
'spec/**/*.pp',
'tests/**/*.pp',
]


Rake::Task[:lint].clear
PuppetLint::RakeTask.new :lint do |config|
# Pattern of files to ignore
config.ignore_paths = ignore_paths

# List of checks to disable
config.disable_checks = [
'80chars',
'class_inherits_from_params_class',
'documentation',
]

# Should the task fail if there were any warnings, defaults to false
config.fail_on_warnings = true

# Print out the context for the problem, defaults to false
config.with_context = true

# Format string for puppet-lint's output (see the puppet-lint help output
# for details
config.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"

# Compare module layout relative to the module root
# config.relative = true
end

PuppetSyntax.exclude_paths = ignore_paths

task :default => [
:syntax,
:lint,
:spec,
]

## Why not
task :future do |args|
PuppetSyntax.future_parser = true
Rake::Task[:syntax].invoke
end

desc "Populate CONTRIBUTORS file"
task :contributors do
system("git log --format='%aN, %aE' | sort -u > CONTRIBUTORS")
end

namespace :init do
task :bundler do
puts "=> Running 'bundle install'"
sh("bundle", "install")
end

task :hooks do
puts "=> Copying git hooks to ./.git/hooks/"
sh("cp -rf #{repo_dir}/.githooks/* #{repo_dir}/.git/hooks")
end
end

task :init do
Rake::Task['init:bundler'].invoke
Rake::Task['init:hooks'].invoke

puts
puts "======================================================================"
puts "Repo initialized"
puts
puts "You should now have a development environment setup."
puts "Execute 'rake -T' to see the available rake tasks."
puts " For example: rake syntax"
puts
puts "pre-commit hooks for Git were also initialized. Whenever you commit,"
puts "your changes will be validated against puppet syntax, puppet-lint,"
puts "and Ruby validation (erb, yaml, json)."
end
21 changes: 16 additions & 5 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,32 @@
require crowd

File {
owner => $crowd::user,
group => $crowd::group,
owner => $crowd::user,
group => $crowd::group,
mode => '0644',
require => Class['crowd::install'],
notify => Class['crowd::service'],
}

file {"${crowd::webappdir}/crowd-webapp/WEB-INF/classes/crowd-init.properties":
if ($crowd::java_home == undef) {
fail('Please set a value for the java_home parameter.')
}

file { "${crowd::webappdir}/apache-tomcat/bin/setenv.sh":
ensure => 'file',
content => template('crowd/setenv.sh.erb'),
mode => '0755',
}

file { "${crowd::webappdir}/crowd-webapp/WEB-INF/classes/crowd-init.properties":
content => template('crowd/crowd-init.properties.erb'),
}

file {"${crowd::webappdir}/apache-tomcat/conf/Catalina/localhost/openidserver.xml":
file { "${crowd::webappdir}/apache-tomcat/conf/Catalina/localhost/openidserver.xml":
content => template('crowd/openidserver.xml.erb'),
}

file {"${crowd::webappdir}/crowd-openidserver-webapp/WEB-INF/classes/jdbc.properties":
file { "${crowd::webappdir}/crowd-openidserver-webapp/WEB-INF/classes/jdbc.properties":
content => template('crowd/jdbc.properties.erb'),
}
}
16 changes: 10 additions & 6 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#
# This module is used to install Crowd.
#
# This module requires mkrakowitzer-deploy and maestrodev-wget
#
# Format modeled on from @brycejohnson & @mkrakowitzer 's / puppet-jira module
#
# === Parameters
Expand Down Expand Up @@ -56,13 +54,19 @@
$idjdbcversion = $crowd::params::idjdbcversion,

# Misc Settings
$downloadURL = $crowd::params::downloadURL,
$download_url = $crowd::params::download_url,
$service_provider = $crowd::params::service_provider,
$service_enable = $crowd::params::service_enable,
$java_home = $crowd::params::java_home,
$jvm_xms = $crowd::params::jvm_xms,
$jvm_xmx = $crowd::params::jvm_xmx,
$jvm_opts = $crowd::params::jvm_opts,

) inherits crowd::params {

$webappdir = "${installdir}/atlassian-${product}-${version}-standalone"
$dburl = "jdbc:${db}://${dbserver}:${dbport}/${dbname}"
$iddburl = "jdbc:${iddb}://${iddbserver}:${iddbport}/${iddbname}"
$webappdir = "${installdir}/atlassian-${product}-${version}-standalone"
$dburl = "jdbc:${db}://${dbserver}:${dbport}/${dbname}"
$iddburl = "jdbc:${iddb}://${iddbserver}:${iddbport}/${iddbname}"

include crowd::install
include crowd::config
Expand Down
Loading