Skip to content

Commit 53ebd8f

Browse files
committed
Fix bad group for config on FreeBSD
check.pp did not use root_group setting. Make it use this setting to correctly set group. Update corresponding tests.
1 parent 23240f2 commit 53ebd8f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

manifests/check.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
file { "${monit::config_dir}/${name}":
3030
ensure => $ensure,
3131
owner => 'root',
32-
group => 'root',
32+
group => $monit::root_group,
3333
mode => '0644',
3434
source => $source,
3535
content => $content,

spec/defines/check_spec.rb

+7-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@
1515
case facts[:os]['family']
1616
when 'Debian'
1717
config_dir = '/etc/monit/conf.d'
18+
root_group = 'root'
1819
when 'RedHat'
1920
config_dir = '/etc/monit.d'
21+
root_group = 'root'
2022
when 'FreeBSD'
2123
config_dir = '/usr/local/etc/monit.d'
24+
root_group = 'wheel'
2225
else
2326
raise 'unsupported osfamily detected'
2427
end
@@ -30,7 +33,7 @@
3033
it do
3134
is_expected.to contain_file("#{config_dir}/test").with('ensure' => 'present',
3235
'owner' => 'root',
33-
'group' => 'root',
36+
'group' => root_group,
3437
'mode' => '0644',
3538
'source' => nil,
3639
'content' => nil,
@@ -50,7 +53,7 @@
5053
it do
5154
is_expected.to contain_file("#{config_dir}/test").with('ensure' => value,
5255
'owner' => 'root',
53-
'group' => 'root',
56+
'group' => root_group,
5457
'mode' => '0644',
5558
'source' => nil,
5659
'content' => nil,
@@ -77,7 +80,7 @@
7780
it do
7881
is_expected.to contain_file("#{config_dir}/test").with('ensure' => 'present',
7982
'owner' => 'root',
80-
'group' => 'root',
83+
'group' => root_group,
8184
'mode' => '0644',
8285
'source' => nil,
8386
'content' => content,
@@ -96,7 +99,7 @@
9699
it do
97100
is_expected.to contain_file("#{config_dir}/test").with('ensure' => 'present',
98101
'owner' => 'root',
99-
'group' => 'root',
102+
'group' => root_group,
100103
'mode' => '0644',
101104
'source' => 'puppet:///modules/monit/ntp',
102105
'content' => nil,

0 commit comments

Comments
 (0)