Skip to content

Commit b71baf8

Browse files
committed
Fixes #30292: Set ownership on SSL key
1 parent 25620e4 commit b71baf8

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

manifests/config.pp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,12 @@
137137
}
138138
}
139139
}
140+
141+
if !$foreman_proxy::manage_puppet_group and $foreman_proxy::ssl {
142+
file { $foreman_proxy::ssl_key:
143+
group => $foreman_proxy::user,
144+
mode => '0640',
145+
before => Service['foreman-proxy'],
146+
}
147+
}
140148
}

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
$etc = '/etc'
1818
$shell = '/bin/false'
1919
$user = pick($foreman_proxy::globals::user, 'foreman-proxy')
20+
$group = pick($foreman_proxy::globals::group, 'foreman-proxy')
2021

2122
$dhcp_config = '/etc/dhcp/dhcpd.conf'
2223
$dhcp_leases = '/var/lib/dhcpd/dhcpd.leases'

spec/classes/foreman_proxy__spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,15 @@
385385
end
386386
end
387387

388+
context 'when not managing puppet group' do
389+
it "should manage ssl_key" do
390+
should contain_file("/etc/puppetlabs/puppet/ssl/private_keys/#{facts['networking']['fqdn']}")
391+
.with_mode('0640')
392+
.with_group('foreman-proxy')
393+
.with_before('Service["foreman-proxy"]')
394+
end
395+
end
396+
388397
context 'with custom foreman_ssl params' do
389398
let :params do
390399
super().merge(

0 commit comments

Comments
 (0)