Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove management of logging_file and logging_dir #375

Merged
merged 1 commit into from
Oct 19, 2023
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
7 changes: 7 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ The following parameters are available in the `icingaweb2::globals` class:

* [`package_name`](#-icingaweb2--globals--package_name)
* [`conf_dir`](#-icingaweb2--globals--conf_dir)
* [`state_dir`](#-icingaweb2--globals--state_dir)
* [`data_dir`](#-icingaweb2--globals--data_dir)
* [`role_replace`](#-icingaweb2--globals--role_replace)
* [`comp_db_schema_dir`](#-icingaweb2--globals--comp_db_schema_dir)
Expand Down Expand Up @@ -575,6 +576,12 @@ Data type: `Stdlib::Absolutepath`

Path to the config files.

##### <a name="-icingaweb2--globals--state_dir"></a>`state_dir`

Data type: `Stdlib::Absolutepath`

Path to variable application data.

##### <a name="-icingaweb2--globals--data_dir"></a>`data_dir`

Data type: `Stdlib::Absolutepath`
Expand Down
1 change: 1 addition & 0 deletions data/FreeBSD.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
icingaweb2::globals::package_name: icingaweb2-php74
icingaweb2::globals::conf_dir: /usr/local/etc/icingaweb2
icingaweb2::globals::state_dir: /usr/local/var/icingaweb2
icingaweb2::globals::data_dir: /usr/local/www/icingaweb2
icingaweb2::globals::comp_db_schema_dir: /usr/local/www/icingaweb2/etc
icingaweb2::globals::mysql_db_schema: /usr/local/www/icingaweb2/etc/schema/mysql.schema.sql
Expand Down
1 change: 1 addition & 0 deletions data/Linux-kernel.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
icingaweb2::globals::package_name: icingaweb2
icingaweb2::globals::conf_dir: /etc/icingaweb2
icingaweb2::globals::state_dir: /var/lib/icingaweb2
icingaweb2::globals::data_dir: /usr/share/icingaweb2
icingaweb2::globals::comp_db_schema_dir: /usr/share/doc/icingaweb2
icingaweb2::globals::mysql_db_schema: /usr/share/doc/icingaweb2/schema/mysql.schema.sql
Expand Down
29 changes: 0 additions & 29 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
class icingaweb2::config {
$conf_dir = $icingaweb2::globals::conf_dir
$default_module_path = $icingaweb2::globals::default_module_path
$conf_user = $icingaweb2::conf_user
$conf_group = $icingaweb2::conf_group

$logging = $icingaweb2::logging
$logging_file = $icingaweb2::logging_file
$logging_dir = dirname($icingaweb2::logging_file)
$logging_level = $icingaweb2::logging_level
$logging_facility = $icingaweb2::logging_facility
$logging_application = $icingaweb2::logging_application
Expand Down Expand Up @@ -61,29 +58,13 @@
cipher => $icingaweb2::tls_cipher,
}

File {
mode => '0660',
owner => $conf_user,
group => $conf_group,
}

Exec {
path => $facts['path'],
provider => shell,
user => 'root',
require => Icingaweb2::Tls::Client['icingaweb2 tls client config'],
}

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

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

icingaweb2::inisection { 'config-logging':
section_name => 'logging',
target => "${conf_dir}/config.ini",
Expand Down Expand Up @@ -137,16 +118,6 @@
}
}

file { "${conf_dir}/modules":
ensure => directory,
mode => '2770',
}

file { "${conf_dir}/enabledModules":
ensure => directory,
mode => '2770',
}

# Additional resources
$resources.each |String $res, Hash $cfg| {
case $cfg['type'] {
Expand Down
4 changes: 4 additions & 0 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# @param conf_dir
# Path to the config files.
#
# @param state_dir
# Path to variable application data.
#
# @param data_dir
# Location of PHP data files.
#
Expand Down Expand Up @@ -66,6 +69,7 @@
class icingaweb2::globals (
String $package_name,
Stdlib::Absolutepath $conf_dir,
Stdlib::Absolutepath $state_dir,
Stdlib::Absolutepath $data_dir,
Boolean $role_replace,
Stdlib::Absolutepath $comp_db_schema_dir,
Expand Down
36 changes: 24 additions & 12 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@
assert_private("You're not supposed to use this defined type manually.")

$conf_dir = $icingaweb2::globals::conf_dir
$state_dir = $icingaweb2::globals::state_dir
$package_name = $icingaweb2::globals::package_name
$data_dir = $icingaweb2::globals::data_dir
$comp_dir = $icingaweb2::globals::comp_db_schema_dir
$manage_package = $icingaweb2::manage_package
$extra_packages = $icingaweb2::extra_packages
$conf_user = $icingaweb2::conf_user
$conf_group = $icingaweb2::conf_group
$data_dir = $icingaweb2::globals::data_dir
$comp_dir = $icingaweb2::globals::comp_db_schema_dir

File {
mode => '0660',
owner => $conf_user,
group => $conf_group,
}

#
# Packages
#
if $manage_package {
package { $package_name:
ensure => installed,
Expand All @@ -36,11 +33,26 @@
}
}

file { prefix(['navigation', 'preferences', 'dashboards'], "${conf_dir}/"):
ensure => directory,
mode => '2770',
#
# Additional filesystem structure
#
file {
default:
ensure => directory,
owner => root,
group => $conf_group,
;
prefix(['modules', 'enabledModules', 'navigation', 'preferences', 'dashboards'], "${conf_dir}/"):
mode => '2770',
;
"${state_dir}/certs":
mode => '2770',
;
}

#
# Compatmode: db schema files were moved in Icinga Web 2.11.0
#
file { $comp_dir:
ensure => directory,
owner => 'root',
Expand Down
10 changes: 0 additions & 10 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@
}
it { is_expected.to contain_icingaweb2__inisection('config-themes') }
it { is_expected.not_to contain_icingaweb2__inisection('config-cookie') }
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')
}

it { is_expected.to contain_icingaweb2__resource__database('mysql-icingaweb2') }
it { is_expected.not_to contain_exec('import schema') }
Expand Down
Loading