diff --git a/manifests/init.pp b/manifests/init.pp index b51b697..10f49d3 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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,}, diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 3259751..a0949c2 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -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 => {