Skip to content

Commit

Permalink
Fixes #30292: Set ownership on SSL key
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Jul 2, 2020
1 parent 25620e4 commit b71baf8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,12 @@
}
}
}

if !$foreman_proxy::manage_puppet_group and $foreman_proxy::ssl {
file { $foreman_proxy::ssl_key:
group => $foreman_proxy::user,
mode => '0640',
before => Service['foreman-proxy'],
}
}
}
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
$etc = '/etc'
$shell = '/bin/false'
$user = pick($foreman_proxy::globals::user, 'foreman-proxy')
$group = pick($foreman_proxy::globals::group, 'foreman-proxy')

$dhcp_config = '/etc/dhcp/dhcpd.conf'
$dhcp_leases = '/var/lib/dhcpd/dhcpd.leases'
Expand Down
9 changes: 9 additions & 0 deletions spec/classes/foreman_proxy__spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,15 @@
end
end

context 'when not managing puppet group' do
it "should manage ssl_key" do
should contain_file("/etc/puppetlabs/puppet/ssl/private_keys/#{facts['networking']['fqdn']}")
.with_mode('0640')
.with_group('foreman-proxy')
.with_before('Service["foreman-proxy"]')
end
end

context 'with custom foreman_ssl params' do
let :params do
super().merge(
Expand Down

0 comments on commit b71baf8

Please sign in to comment.