From 509f86b9ba1f152427fcc9b2a30b99c293d65dfd Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 7 Jul 2023 14:25:26 +0200 Subject: [PATCH] Refs #36573 - Drop default value for foreman_url This default matches what's in theforeman/puppetserver_foreman and is not needed. Users can still override it, but the default just duplicates things. --- manifests/init.pp | 2 +- manifests/params.pp | 2 +- manifests/server.pp | 2 +- spec/classes/puppet_server_spec.rb | 10 +++------- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 121fb96f..533757b9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -693,7 +693,7 @@ Boolean $server_strict_variables = $puppet::params::server_strict_variables, Hash[String, Data] $server_additional_settings = $puppet::params::server_additional_settings, Boolean $server_foreman = $puppet::params::server_foreman, - Stdlib::HTTPUrl $server_foreman_url = $puppet::params::server_foreman_url, + Optional[Stdlib::HTTPUrl] $server_foreman_url = $puppet::params::server_foreman_url, Optional[Stdlib::Absolutepath] $server_foreman_ssl_ca = $puppet::params::server_foreman_ssl_ca, Optional[Stdlib::Absolutepath] $server_foreman_ssl_cert = $puppet::params::server_foreman_ssl_cert, Optional[Stdlib::Absolutepath] $server_foreman_ssl_key = $puppet::params::server_foreman_ssl_key, diff --git a/manifests/params.pp b/manifests/params.pp index 7dd4107f..1b508fbd 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -329,7 +329,7 @@ true => '/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet', false => undef, } - $server_foreman_url = "https://${lower_fqdn}" + $server_foreman_url = undef $server_foreman_ssl_ca = undef $server_foreman_ssl_cert = undef $server_foreman_ssl_key = undef diff --git a/manifests/server.pp b/manifests/server.pp index 70c15332..aecc6579 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -404,7 +404,7 @@ Boolean $strict_variables = $puppet::server_strict_variables, Hash[String, Data] $additional_settings = $puppet::server_additional_settings, Boolean $foreman = $puppet::server_foreman, - Stdlib::HTTPUrl $foreman_url = $puppet::server_foreman_url, + Optional[Stdlib::HTTPUrl] $foreman_url = $puppet::server_foreman_url, Optional[Stdlib::Absolutepath] $foreman_ssl_ca = $puppet::server_foreman_ssl_ca, Optional[Stdlib::Absolutepath] $foreman_ssl_cert = $puppet::server_foreman_ssl_cert, Optional[Stdlib::Absolutepath] $foreman_ssl_key = $puppet::server_foreman_ssl_key, diff --git a/spec/classes/puppet_server_spec.rb b/spec/classes/puppet_server_spec.rb index e8193cb3..abb2864b 100644 --- a/spec/classes/puppet_server_spec.rb +++ b/spec/classes/puppet_server_spec.rb @@ -154,15 +154,11 @@ it { should contain_class('puppet::server::puppetserver') } end - describe 'with uppercase hostname' do - let(:facts) do - override_facts(super(), - networking: {fqdn: 'PUPPETSERVER.example.com'}, - ) - end + describe 'with server_foreman_url' do + let(:params) { super().merge(server_foreman_url: 'https://foreman.example.com') } it { should compile.with_all_deps } - it { should contain_class('puppet').with_server_foreman_url('https://puppetserver.example.com') } + it { should contain_class('puppet').with_server_foreman_url('https://foreman.example.com') } end describe 'with ip parameter' do