Merge "Update default api configurations"
commit
cc34f5f770
|
@ -14,10 +14,28 @@ class openstack_health::api(
|
|||
$server_admin = "webmaster@${::fqdn}",
|
||||
$vhost_name = 'localhost',
|
||||
$vhost_port = 5000,
|
||||
$ignored_run_metadata_keys = undef,
|
||||
) {
|
||||
|
||||
include ::httpd::mod::wsgi
|
||||
|
||||
$default_ignored_run_metadata_keys = ['build_change', 'build_node',
|
||||
'build_patchset', 'build_ref',
|
||||
'build_short_uuid', 'build_uuid',
|
||||
'build_zuul_url', 'filename']
|
||||
|
||||
if $ignored_run_metadata_keys {
|
||||
# In case it was defined, ensure the value provided is an array
|
||||
if is_array($ignored_run_metadata_keys) {
|
||||
$ignored_keys = $ignored_run_metadata_keys
|
||||
} else {
|
||||
fail('$ignored_run_metadata_keys parameter should be an array of strings')
|
||||
}
|
||||
} else {
|
||||
# In case it was not defined, use the default value
|
||||
$ignored_keys = $default_ignored_run_metadata_keys
|
||||
}
|
||||
|
||||
$api_dir = "${source_dir}/openstack_health"
|
||||
$virtualenv_dir = "${source_dir}/.venv"
|
||||
|
||||
|
|
|
@ -43,6 +43,10 @@ describe 'puppet-openstack_health::api manifest', :if => ['debian', 'ubuntu'].in
|
|||
it { should be_file }
|
||||
it { should be_owned_by 'openstack_health' }
|
||||
it { should be_grouped_into 'openstack_health' }
|
||||
its(:content) { should contain 'db_uri' }
|
||||
its(:content) { should contain 'ignored_run_metadata_keys' }
|
||||
its(:content) { should contain 'build_change' }
|
||||
its(:content) { should contain 'build_zuul_url' }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,2 +1,8 @@
|
|||
[default]
|
||||
db_uri = <%= scope.lookupvar("openstack_health::api::db_uri") %>
|
||||
<% if @ignored_keys.length > 0 -%>
|
||||
ignored_run_metadata_keys =
|
||||
<% @ignored_keys.each do |ignored_key| -%>
|
||||
<%= ignored_key %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
|
Loading…
Reference in New Issue