diff --git a/manifests/puppetmaster.pp b/manifests/puppetmaster.pp index fd560f16f..2000e377b 100644 --- a/manifests/puppetmaster.pp +++ b/manifests/puppetmaster.pp @@ -2,8 +2,6 @@ # is intented to be added to your puppetmaster class foreman::puppetmaster ( Stdlib::HTTPUrl $foreman_url = $::foreman::puppetmaster::params::foreman_url, - Optional[String] $foreman_user = $::foreman::puppetmaster::params::foreman_user, - Optional[String] $foreman_password = $::foreman::puppetmaster::params::foreman_password, Boolean $reports = $::foreman::puppetmaster::params::reports, Boolean $enc = $::foreman::puppetmaster::params::enc, Boolean $receive_facts = $::foreman::puppetmaster::params::receive_facts, @@ -17,8 +15,6 @@ Variant[Enum[''], Stdlib::Absolutepath] $ssl_ca = $::foreman::puppetmaster::params::client_ssl_ca, Variant[Enum[''], Stdlib::Absolutepath] $ssl_cert = $::foreman::puppetmaster::params::client_ssl_cert, Variant[Enum[''], Stdlib::Absolutepath] $ssl_key = $::foreman::puppetmaster::params::client_ssl_key, - Enum['v2'] $enc_api = 'v2', - Enum['v2'] $report_api = 'v2', ) inherits foreman::puppetmaster::params { case $::osfamily { @@ -45,14 +41,14 @@ mode => '0644', owner => 'root', group => '0', - source => "puppet:///modules/${module_name}/foreman-report_${report_api}.rb", + source => "puppet:///modules/${module_name}/foreman-report_v2.rb", require => Exec['Create Puppet Reports dir'], } } if $enc { file { "${puppet_etcdir}/node.rb": - source => "puppet:///modules/${module_name}/external_node_${enc_api}.rb", + source => "puppet:///modules/${module_name}/external_node_v2.rb", mode => '0550', owner => $puppet_user, group => $puppet_group, diff --git a/manifests/puppetmaster/params.pp b/manifests/puppetmaster/params.pp index 8e1f150e5..88392042b 100644 --- a/manifests/puppetmaster/params.pp +++ b/manifests/puppetmaster/params.pp @@ -4,8 +4,6 @@ # Basic configurations $foreman_url = "https://${lower_fqdn}" - $foreman_user = undef - $foreman_password = undef # Should foreman act as an external node classifier (manage puppet class # assignments) $enc = true diff --git a/spec/classes/foreman_puppetmaster_spec.rb b/spec/classes/foreman_puppetmaster_spec.rb index b8a47db58..078720c55 100644 --- a/spec/classes/foreman_puppetmaster_spec.rb +++ b/spec/classes/foreman_puppetmaster_spec.rb @@ -62,19 +62,23 @@ it 'should create puppet.yaml' do should contain_file("#{etc_dir}/puppet/foreman.yaml") - .with_content(%r{^:url: "https://#{facts[:fqdn]}"$}) - .with_content(%r{^:ssl_ca: "#{puppet_vardir}/ssl/certs/ca.pem"$}) - .with_content(%r{^:ssl_cert: "#{puppet_vardir}/ssl/certs/#{facts[:fqdn]}.pem"$}) - .with_content(%r{^:ssl_key: "#{puppet_vardir}/ssl/private_keys/#{facts[:fqdn]}.pem"$}) - .with_content(/^:user: ""$/) - .with_content(/^:password: ""$/) - .with_content(/^:puppetdir: "#{puppet_vardir}"$/) - .with_content(/^:facts: true$/) - .with_content(/^:timeout: 60$/) - .with_content(/^:report_timeout: 60$/) .with_mode('0640') .with_owner('root') .with_group('puppet') + + verify_exact_contents(catalogue, "#{etc_dir}/puppet/foreman.yaml", [ + "---", + ":url: \"https://#{facts[:fqdn]}\"", + ":ssl_ca: \"#{puppet_vardir}/ssl/certs/ca.pem\"", + ":ssl_cert: \"#{puppet_vardir}/ssl/certs/#{facts[:fqdn]}.pem\"", + ":ssl_key: \"#{puppet_vardir}/ssl/private_keys/#{facts[:fqdn]}.pem\"", + ":puppetdir: \"#{puppet_vardir}\"", + ':puppetuser: "puppet"', + ':facts: true', + ':timeout: 60', + ':report_timeout: 60', + ':threads: null', + ]) end end diff --git a/templates/puppet.yaml.erb b/templates/puppet.yaml.erb index d5e7e95fd..1d64c2dc6 100644 --- a/templates/puppet.yaml.erb +++ b/templates/puppet.yaml.erb @@ -3,8 +3,6 @@ :ssl_ca: "<%= @ssl_ca %>" :ssl_cert: "<%= @ssl_cert %>" :ssl_key: "<%= @ssl_key %>" -:user: "<%= @foreman_user %>" -:password: "<%= @foreman_password %>" :puppetdir: "<%= @puppet_home %>" :puppetuser: "<%= @puppet_user %>" :facts: <%= @receive_facts %>