From c5c5c93f046ac94a780a28b588d98da499b43f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= Date: Mon, 27 Oct 2014 09:35:23 +0100 Subject: [PATCH 1/4] Use a hash for $puppetserver::config --- manifests/config.pp | 35 ++++++++++++++++++++++------------- manifests/init.pp | 9 +++++++-- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 82d072e..9dec745 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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'], + } + } } } diff --git a/manifests/init.pp b/manifests/init.pp index dd18aab..4adf680 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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': } ~> From 9eab7ee03d0a101895324e13fa2cd7c54534d532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= Date: Mon, 27 Oct 2014 09:38:48 +0100 Subject: [PATCH 2/4] No need to depend on augeasproviders_shellvar anymore --- .fixtures.yml | 2 -- metadata.json | 8 -------- 2 files changed, 10 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index eb6ca2f..8f35342 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -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}" diff --git a/metadata.json b/metadata.json index d493b85..a6261d9 100644 --- a/metadata.json +++ b/metadata.json @@ -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" } ] } From 94dd14e4515943db43c62ad4a44b2e0fe7ae5488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= Date: Mon, 27 Oct 2014 09:44:25 +0100 Subject: [PATCH 3/4] Typo --- manifests/config.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 9dec745..958176a 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -4,7 +4,7 @@ ::puppetserver::config::java_arg { '-Xms': ensure => 'present', - value => $::puppetserver::config['java_args']['Xms'], + value => $::puppetserver::config['java_args']['xms'], } } @@ -12,7 +12,7 @@ ::puppetserver::config::java_arg { '-Xmx': ensure => 'present', - value => $::puppetserver::config['java_args']['Xmx'], + value => $::puppetserver::config['java_args']['xmx'], } } @@ -20,7 +20,7 @@ ::puppetserver::config::java_arg { '-XX:MaxPermSize=': ensure => 'present', - value => $::puppetserver::config['java_args']['MaxPermsize'], + value => $::puppetserver::config['java_args']['maxpermsize'], } } } From c73ce829698761a75cd1dc743c4bc5312b283625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= Date: Mon, 27 Oct 2014 10:08:07 +0100 Subject: [PATCH 4/4] Do not escape quote in JAVA_ARGS --- manifests/config/java_arg.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/config/java_arg.pp b/manifests/config/java_arg.pp index e4df36b..a532e2f 100644 --- a/manifests/config/java_arg.pp +++ b/manifests/config/java_arg.pp @@ -5,7 +5,7 @@ case $ensure { 'present': { $changes = [ - 'set JAVA_ARGS/quote "\""', + 'set JAVA_ARGS/quote \'"\'', "set JAVA_ARGS/value[.=~regexp('${name}.*')] '${name}${value}'", ] }