Skip to content

Commit

Permalink
Fixes permissions on config files
Browse files Browse the repository at this point in the history
Before ini_file was used to create the files, but the permissions were incorrect and you'd get an error message: ![Error](https://cloud.githubusercontent.com/assets/1064715/13003982/91bfc7ea-d170-11e5-9eb4-4fc135140f83.png)
  • Loading branch information
petems committed Feb 12, 2016
1 parent 96211d8 commit a6cb422
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
10 changes: 10 additions & 0 deletions manifests/mod/monitoring.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
mode => $::icingaweb2::config_file_mode,
}

$monitoring_mod_files = [
"${::icingaweb2::config_dir}/modules/monitoring/backends.ini",
"${::icingaweb2::config_dir}/modules/monitoring/config.ini",
"${::icingaweb2::config_dir}/modules/monitoring/commandtransports.ini",
]

file { $monitoring_mod_files:
ensure => present,
}

file { "${::icingaweb2::config_dir}/modules/monitoring":
ensure => directory,
mode => $::icingaweb2::config_dir_mode;
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
case $::osfamily {
'RedHat': {
$config_dir = '/etc/icingaweb2'
$config_dir_mode = '0755'
$config_dir_mode = '2770'
$config_dir_purge = false
$config_dir_recurse = false
$config_file_mode = '0664'
Expand Down
19 changes: 19 additions & 0 deletions spec/classes/icingaweb2_mod_monitoring_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@
end

describe 'without parameters' do

[
'backends',
'config',
'commandtransports',
].each do | config_file |

it {
should contain_file("/etc/icingaweb2/modules/monitoring/#{config_file}.ini").
with(
{
'owner' => 'icingaweb2',
'group' => 'icingaweb2',
'mode' => '0644',
}
)
}
end

it { should contain_ini_setting('security settings').with(
'section' => /security/,
'setting' => /protected_customvars/,
Expand Down

0 comments on commit a6cb422

Please sign in to comment.