Showing with 33 additions and 17 deletions.
  1. +8 −0 CHANGELOG.md
  2. +14 −16 manifests/plugin/puppetdb.pp
  3. +1 −1 metadata.json
  4. +10 −0 spec/classes/plugin/puppetdb_spec.rb
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [15.0.1](https://github.com/theforeman/puppet-foreman/tree/15.0.1) (2020-06-15)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/15.0.0...15.0.1)

**Fixed bugs:**

- Fixes [\#30026](https://projects.theforeman.org/issues/30026) - Ensure Foreman is provisioned before puppetdb [\#852](https://github.com/theforeman/puppet-foreman/pull/852) ([ekohl](https://github.com/ekohl))

## [15.0.0](https://github.com/theforeman/puppet-foreman/tree/15.0.0) (2020-05-15)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/14.0.0...15.0.0)
Expand Down
30 changes: 14 additions & 16 deletions manifests/plugin/puppetdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,20 @@
foreman::plugin { 'puppetdb':
package => $foreman::plugin_prefix.regsubst(/foreman[_-]/, 'puppetdb_foreman'),
}
-> foreman_config_entry { 'puppetdb_enabled':
value => true,

$config = {
'puppetdb_enabled' => true,
'puppetdb_address' => $address,
'puppetdb_ssl_ca_file' => $ssl_ca_file,
'puppetdb_ssl_certificate' => $ssl_certificate,
'puppetdb_ssl_private_key' => $ssl_private_key,
'puppetdb_api_version' => $api_version,
}
-> foreman_config_entry { 'puppetdb_address':
value => $address,
}
-> foreman_config_entry { 'puppetdb_ssl_ca_file':
value => $ssl_ca_file,
}
-> foreman_config_entry { 'puppetdb_ssl_certificate':
value => $ssl_certificate,
}
-> foreman_config_entry { 'puppetdb_ssl_private_key':
value => $ssl_private_key,
}
-> foreman_config_entry { 'puppetdb_api_version':
value => $api_version,

$config.each |$setting, $value| {
foreman_config_entry { $setting:
value => $value,
require => Class['foreman::database'],
}
}
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-foreman",
"version": "15.0.0",
"version": "15.0.1",
"author": "theforeman",
"summary": "Foreman server configuration",
"license": "GPL-3.0+",
Expand Down
10 changes: 10 additions & 0 deletions spec/classes/plugin/puppetdb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@

it { should compile.with_all_deps }
it { should contain_foreman__plugin('puppetdb').with_package(package_name) }
it do
should contain_foreman_config_entry('puppetdb_enabled')
.with_value(true)
.that_requires(['Class[foreman::database]', 'Foreman::Plugin[puppetdb]'])
end
it do
should contain_foreman_config_entry('puppetdb_address')
.with_value('https://localhost:8081/pdb/cmd/v1')
.that_requires(['Class[foreman::database]', 'Foreman::Plugin[puppetdb]'])
end
end
end
end