Skip to content

Commit

Permalink
Drop {enc,report}_api parameters
Browse files Browse the repository at this point in the history
Parameters with a single value aren't really useful.
  • Loading branch information
ekohl committed Apr 16, 2020
1 parent c336f64 commit 31850c8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
6 changes: 2 additions & 4 deletions manifests/puppetmaster.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,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 {
Expand All @@ -43,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,
Expand Down
24 changes: 14 additions & 10 deletions spec/classes/foreman_puppetmaster_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 31850c8

Please sign in to comment.