Skip to content

Commit

Permalink
Merge branch 'feature/add-logging-dir'
Browse files Browse the repository at this point in the history
closes #172
  • Loading branch information
bobapple committed Sep 25, 2017
2 parents 691e3fc + 0fd7ed9 commit 9978ce8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

$logging = $::icingaweb2::logging
$logging_file = $::icingaweb2::logging_file
$logging_dir = dirname($::icingaweb2::logging_file)
$logging_level = $::icingaweb2::logging_level
$show_stacktraces = $::icingaweb2::show_stacktraces
$module_path = $::icingaweb2::module_path
Expand Down Expand Up @@ -51,6 +52,15 @@
path => $::path,
}

file { $logging_dir:
ensure => directory,
mode => '0750',
}
file { $logging_file:
ensure => file,
mode => '0640',
}

icingaweb2::inisection {'logging':
target => "${conf_dir}/config.ini",
settings => {
Expand Down
8 changes: 8 additions & 0 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
.with_settings({ 'show_stacktraces' => false, 'module_path' => '/usr/share/icingaweb2/modules', 'config_backend' => 'ini' })
}
it { is_expected.to contain_icingaweb2__inisection('themes') }
it { is_expected.to contain_file('/var/log/icingaweb2')
.with_ensure('directory')
.with_mode('0750')
}
it { is_expected.to contain_file('/var/log/icingaweb2/icingaweb2.log')
.with_ensure('file')
.with_mode('0640')
}
end

context 'with import_schema => true and db_type => mysql' do
Expand Down

0 comments on commit 9978ce8

Please sign in to comment.