Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Manage configuration options with a hash #2

Merged
merged 4 commits into from
Oct 27, 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
2 changes: 0 additions & 2 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
fixtures:
repositories:
apt: https://github.com/puppetlabs/puppetlabs-apt.git
augeasproviders_core: https://github.com/hercules-team/augeasproviders_core.git
augeasproviders_shellvar: https://github.com/hercules-team/augeasproviders_shellvar.git
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
symlinks:
puppetserver: "#{source_dir}"
35 changes: 22 additions & 13 deletions manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
class puppetserver::config {
::puppetserver::config::java_arg {
'-Xms':
ensure => 'present',
value => $::puppetserver::java_xms,
;
if has_key($::puppetserver::config, 'java_args') {
if has_key($::puppetserver::config['java_args'], 'xms') {
::puppetserver::config::java_arg {
'-Xms':
ensure => 'present',
value => $::puppetserver::config['java_args']['xms'],
}
}

'-Xmx':
ensure => 'present',
value => $::puppetserver::java_xmx,
;
if has_key($::puppetserver::config['java_args'], 'xmx') {
::puppetserver::config::java_arg {
'-Xmx':
ensure => 'present',
value => $::puppetserver::config['java_args']['xmx'],
}
}

'-XX:MaxPermSize=':
ensure => 'present',
value => '256m',
;
if has_key($::puppetserver::config['java_args'], 'maxpermsize') {
::puppetserver::config::java_arg {
'-XX:MaxPermSize=':
ensure => 'present',
value => $::puppetserver::config['java_args']['maxpermsize'],
}
}
}
}
2 changes: 1 addition & 1 deletion manifests/config/java_arg.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
case $ensure {
'present': {
$changes = [
'set JAVA_ARGS/quote "\""',
'set JAVA_ARGS/quote \'"\'',
"set JAVA_ARGS/value[.=~regexp('${name}.*')] '${name}${value}'",
]
}
Expand Down
9 changes: 7 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
$enable = true,
$start = true,

$java_xms = '2g',
$java_xmx = '2g',
$config = {
'java_args' => {
'xms' => '2g',
'xmx' => '2g',
'maxpermsize' => '256m',
},
},
) {
class { 'puppetserver::install': } ->
class { 'puppetserver::config': } ~>
Expand Down
8 changes: 0 additions & 8 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
{
"name": "puppetlabs/stdlib",
"version_requirement": ">=3.2.0 <5.0.0"
},
{
"name": "herculesteam/augeasproviders_core",
"version_requirement": ">=2.0.0"
},
{
"name": "herculesteam/augeasproviders_shellvar",
"version_requirement": ">=2.0.0"
}
]
}
Expand Down