Skip to content

Commit

Permalink
add possibility to disable default options
Browse files Browse the repository at this point in the history
  • Loading branch information
cristifalcas committed May 18, 2017
1 parent ed7b273 commit 28ac402
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
class journald::config {
$merged_options = merge($::journald::params::default_options, $::journald::options)
if $::journald::enable_defaults {
$merged_options = merge($::journald::params::default_options, $::journald::options)
} else {
$merged_options = $::journald::options
}

if $::journald::persist_log {
$journald_dir = 'directory'
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
# data persistent, it is sufficient to create /var/log/journal/
# where systemd-journald will then store the data.
#
# $enable_defaults:: if defaults parameters should be used or not
#
# $options:: a hash with journald parameters
#
class journald (
$persist_log = $journald::params::persist_log,
$enable_defaults = $journald::params::enable_defaults,
$options = undef
) inherits journald::params {
if $::osfamily == 'RedHat' and versioncmp($::operatingsystemrelease, '7.0') >= 0 {
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class journald::params {
$persist_log = true
$enable_defaults = false
$default_options = {
'Storage' => 'auto',
'Compress' => 'yes',
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cristifalcas-journald",
"author": "Cristian Falcas",
"version": "0.3.0",
"version": "0.4.0",
"source": "[email protected]:cristifalcas/puppet-journald.git",
"project_page": "https://github.com/cristifalcas/puppet-journald",
"issues_url": "https://github.com/cristifalcas/puppet-journald/issues",
Expand Down

0 comments on commit 28ac402

Please sign in to comment.