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

Add support for configuring a non-default DB #20

Merged
merged 5 commits into from
Nov 20, 2014
Merged
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: 2 additions & 5 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
$rd_loglevel = $rundeck::rd_loglevel,
$rss_enabled = $rundeck::rss_enabled,
$grails_server_url = $rundeck::grails_server_url,
$dataSource_dbCreate = $rundeck::dataSource_dbCreate,
$dataSource_url = $rundeck::dataSource_url,
$dataSource_config = $rundeck::dataSource_config,
$keystore = $rundeck::keystore,
$keystore_password = $rundeck::keystore_password,
$key_password = $rundeck::key_password,
Expand All @@ -38,9 +37,7 @@
$properties_dir = $framework_properties['framework.etc.dir']

ensure_resource('file', $properties_dir, {'ensure' => 'directory', 'owner' => $user, 'group' => $group} )




if $auth_type == 'file' {
file { "${properties_dir}/jaas-loginmodule.conf":
owner => $user,
Expand Down
23 changes: 12 additions & 11 deletions manifests/config/global/rundeck_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,30 @@
# This private class is called from rundeck::config used to manage the rundeck-config properties
#
class rundeck::config::global::rundeck_config(
$rd_loglevel = $rundeck::config::loglevel,
$rdeck_base = $rundeck::config::rdeck_base,
$rss_enabled = $rundeck::config::rss_enabled,
$grails_server_url = $rundeck::config::grails_server_url,
$dataSource_dbCreate = $rundeck::config::dataSource_dbCreate,
$dataSource_url = $rundeck::config::dataSource_url,
$properties_dir = $rundeck::config::properties_dir,
$user = $rundeck::config::user,
$group = $rundeck::config::group,
$mail_config = $rundeck::config::mail_config
$rd_loglevel = $rundeck::config::loglevel,
$rdeck_base = $rundeck::config::rdeck_base,
$rss_enabled = $rundeck::config::rss_enabled,
$grails_server_url = $rundeck::config::grails_server_url,
$dataSource_config = $rundeck::config::dataSource_config,
$properties_dir = $rundeck::config::properties_dir,
$user = $rundeck::config::user,
$group = $rundeck::config::group,
$mail_config = $rundeck::config::mail_config
) {

$properties_file = "${properties_dir}/rundeck-config.groovy"

ensure_resource('file', $properties_dir, {'ensure' => 'directory', 'owner' => $user, 'group' => $group} )

$dataSource_properties = merge($rundeck::params::dataSource_defaults, $dataSource_config)

file { "${properties_dir}/rundeck-config.properties":
ensure => absent
}

file { $properties_file:
ensure => present,
content => template('rundeck/rundeck-config.erb')
content => template('rundeck/rundeck-config.erb'),
owner => $user,
group => $group,
mode => '0640',
Expand Down
13 changes: 3 additions & 10 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@
# [*grails_server_url*]
# The url used in sending email notifications.
#
# [*dataSource_dbCreate*]
# Configuration setting for how the database schema is updated. Defaults to update.
#
# [*dataSource_url*]
# The jdbc url for the database.
#
# [*keystore*]
# Full path to the java keystore to be used by Rundeck.
#
Expand Down Expand Up @@ -109,8 +103,7 @@
$rd_loglevel = $rundeck::params::loglevel,
$rss_enabled = $rundeck::params::rss_enabled,
$grails_server_url = $rundeck::params::grails_server_url,
$dataSource_dbCreate = $rundeck::params::dataSource_dbCreate,
$dataSource_url = $rundeck::params::dataSource_url,
$dataSource_config = $rundeck::params::dataSource_config,
$keystore = $rundeck::params::keystore,
$keystore_password = $rundeck::params::keystore_password,
$key_password = $rundeck::params::key_password,
Expand All @@ -133,8 +126,8 @@
validate_re($rd_loglevel, ['^ALL$', '^DEBUG$', '^ERROR$', '^FATAL$', '^INFO$', '^OFF$', '^TRACE$', '^WARN$'])
validate_bool($rss_enabled)
validate_string($grails_server_url)
validate_string($dataSource_dbCreate)
validate_string($dataSource_url)
validate_hash($dataSource_config)
validate_absolute_path($keystore)
validate_absolute_path($keystore)
validate_string($keystore_password)
validate_string($key_password)
Expand Down
21 changes: 14 additions & 7 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,17 @@
case $::osfamily {
'Debian': {
$package_name = 'rundeck'
$package_version = '2.2.3-1-GA'
$package_ensure = 'present'
$package_ensure = '2.2.3-1-GA'
$service_name = 'rundeckd'
$jre_name = 'openjdk-6-jre'
$jre_version = '6b30-1.13.1-1ubuntu2~0.12.04.1'
$jre_ensure = 'installed'
}
'RedHat', 'Amazon': {
$package_name = 'rundeck'
$package_version = '2.0.3-1.14.GA'
$package_ensure = 'installed'
$service_name = 'rundeckd'
$jre_name = 'java-1.6.0-openjdk'
$jre_version = '1.6.0.0-1.66.1.13.0.el6'
$jre_ensure = 'installed'
}
default: {
fail("${::operatingsystem} not supported")
Expand Down Expand Up @@ -84,8 +82,17 @@
$rss_enabled = false

$grails_server_url = "http://${::fqdn}:4440"
$dataSource_dbCreate = 'update'
$dataSource_url = 'jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;MVCC=true'

$dataSource_config = {}

$dataSource_defaults = {
'dbCreate' => 'update',
'url' => 'jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;MVCC=true',
'driverClassName' => '',
'username' => '',
'password' => '',
'dialect' => ''
}

$keystore = '/etc/rundeck/ssl/keystore'
$keystore_password = 'adminadmin'
Expand Down
10 changes: 7 additions & 3 deletions templates/rundeck-config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ loglevel.default = "<%= @rd_loglevel %>"
rdeck.base = "<%= @rdeck_base %>"
rss.enabled = "<%= @rss_enabled %>"


dataSource {
dbCreate = "<% @dataSource_dbCreate %>"
url = "<%= @dataSource_url %>"
dbCreate = "<% @dataSource_properties['dbCreate'] %>"
url = "<%= @dataSource_properties['url'] %>"
driverClassName = "<%= @dataSource_properties['driverClassName'] %>"
username = "<%= @dataSource_properties['username'] %>"
password = "<%= @dataSource_properties['password'] %>"
dialect = "<%= @dataSource_properties['dialect'] %>"
}

grails {
Expand All @@ -17,6 +20,7 @@ grails {
props = [<% @mail_config['props'].each do |k,v| -%>"<%= k %>":"<%= v %>",<% end %>]
}
}

grails.mail.default.from = "<%= @mail_config['defaults.from'] %>"

grails.serverURL = "<%= @grails_server_url %>"