From c1cd9d2c1236163f4256c89c6d2e064e06f554a0 Mon Sep 17 00:00:00 2001 From: Thai Pham Date: Tue, 18 Jul 2017 13:35:05 +1000 Subject: [PATCH] Remove the conditional that limits the use of the code to EL7 --- manifests/config.pp | 13 ++++++++----- manifests/init.pp | 16 ++++++++-------- templates/journald.conf.erb | 9 --------- 3 files changed, 16 insertions(+), 22 deletions(-) delete mode 100644 templates/journald.conf.erb diff --git a/manifests/config.pp b/manifests/config.pp index 2420b00..5bbc1be 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -18,10 +18,13 @@ group => 'systemd-journal', } - file { '/etc/systemd/journald.conf': - ensure => 'file', - owner => 0, - group => 0, - content => template("${module_name}/journald.conf.erb"), + $defaults = { + 'path' => '/etc/systemd/journald.conf', + 'notify' => Service['systemd-journald'], } + + $ini_settings = { + 'Journal' => $merged_options, + } + create_ini_settings($ini_settings, $defaults) } diff --git a/manifests/init.pp b/manifests/init.pp index 6f6b288..47a3e6e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,9 +4,9 @@ # # === Parameters: # -# $persist_log:: By default, the journal stores log data in /run/log/journal/. +# $persist_log:: By default, the journal stores log data in /run/log/journal/. # Since /run/ is volatile, log data is lost at reboot. To make the -# data persistent, it is sufficient to create /var/log/journal/ +# 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 @@ -18,11 +18,11 @@ $enable_defaults = $journald::params::enable_defaults, $options = {}, ) inherits journald::params { - if $::osfamily == 'RedHat' and versioncmp($::operatingsystemrelease, '7.0') >= 0 { - contain ::journald::config - contain ::journald::service - Class['journald::config'] ~> - Class['journald::service'] - } + contain ::journald::config + contain ::journald::service + + Class['journald::config'] ~> + Class['journald::service'] + } diff --git a/templates/journald.conf.erb b/templates/journald.conf.erb deleted file mode 100644 index 1a347d0..0000000 --- a/templates/journald.conf.erb +++ /dev/null @@ -1,9 +0,0 @@ -## file generated by puppet -# See journald.conf(5) for details - -[Journal] -<%- scope['journald::config::merged_options'].sort.each do |k, v| -%> -<%- if v != :undef -%> -<%= k %>=<%= v %> -<%- end -%> -<%- end -%>