Skip to content

Commit

Permalink
Fixes #30026 - Ensure Foreman is provisioned before puppetdb
Browse files Browse the repository at this point in the history
This is the same as 81a68c9 but for
puppetdb.
  • Loading branch information
ekohl committed Jun 5, 2020
1 parent 2dc5e7d commit fe7b09a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
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'],
}
}
}
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

0 comments on commit fe7b09a

Please sign in to comment.