Skip to content
Open
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
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
$ini_settings = {
'server' => { setting => 'server', value => $server,},
'ca_server' => { setting => 'ca_server', value => $ca_server,},
'certname' => { setting => 'certname', value => $certname,},
# certname must be lower case
# see https://puppet.com/docs/puppet/latest/configuration.html#certname and https://tickets.puppetlabs.com/browse/PUP-2551
'certname' => { setting => 'certname', value => downcase($certname),},
'environment' => { setting => 'environment', value => $env,},
'trusted_node_data' => { setting => 'trusted_node_data', value => true,},
'graph' => { setting => 'graph', value => $graph,},
Expand Down
15 changes: 15 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,21 @@
end
end

describe 'with certname containing capitalization' do
let(:params) { { :certname => 'puppet.example.COM' } }

it do
should contain_ini_setting('certname').with({
:ensure => 'present',
:setting => 'certname',
:value => 'puppet.example.com',
:path => '/etc/puppetlabs/puppet/puppet.conf',
:section => 'main',
:require => 'File[puppet_config]',
})
end
end

describe 'with custom_settings specified' do
let(:params) { {
:custom_settings => {
Expand Down