Support multiple user config flags settings

This commit is contained in:
Yaguang Tang 2014-11-13 10:54:21 +08:00
parent 726933e27a
commit bbfa6cd543
5 changed files with 38 additions and 2 deletions

View File

@ -22,6 +22,18 @@ options:
default: glance
type: string
description: Glance database name.
api-config-flags:
type: string
description: |
Comma-separated list of key=value pairs to be added to glance-api.conf
where 'value' may itself be a comma-separated list of values to be
assigned to the 'key'.
registry-config-flags:
type: string
description: |
Comma-separated list of key=value pairs to be added to glance-registry.conf
where 'value' may itself be a comma-separated list of values to be
assigned to the 'key'.
region:
default: RegionOne
type: string

View File

@ -84,7 +84,10 @@ CONFIG_FILES = OrderedDict([
context.SyslogContext(),
glance_contexts.LoggingConfigContext(),
glance_contexts.GlanceIPv6Context(),
context.WorkerConfigContext()],
context.WorkerConfigContext(),
context.OSConfigFlagContext(
charm_flag='registry-config-flags',
template_flag='registry_config_flags')],
'services': ['glance-registry']
}),
(GLANCE_API_CONF, {
@ -99,7 +102,10 @@ CONFIG_FILES = OrderedDict([
glance_contexts.LoggingConfigContext(),
glance_contexts.GlanceIPv6Context(),
context.WorkerConfigContext(),
glance_contexts.MultiStoreContext()],
glance_contexts.MultiStoreContext(),
context.OSConfigFlagContext(
charm_flag='api-config-flags',
template_flag='api_config_flags')],
'services': ['glance-api']
}),
(GLANCE_API_PASTE_INI, {

View File

@ -30,6 +30,12 @@ registry_host = {{ registry_host }}
registry_port = 9191
registry_client_protocol = http
{% if api_config_flags -%}
{% for key, value in api_config_flags.iteritems() -%}
{{ key }} = {{ value }}
{% endfor -%}
{% endif -%}
{% include "parts/rabbitmq" %}
{% if rabbitmq_host or rabbitmq_hosts -%}

View File

@ -12,5 +12,11 @@ sql_idle_timeout = 3600
api_limit_max = 1000
limit_param_default = 25
{% if registry_config_flags -%}
{% for key, value in registry_config_flags.iteritems() -%}
{{ key }} = {{ value }}
{% endfor -%}
{% endif -%}
{% include "parts/keystone" %}
{% include "parts/section-database" %}

View File

@ -33,6 +33,12 @@ registry_host = {{ registry_host }}
registry_port = 9191
registry_client_protocol = http
{% if api_config_flags -%}
{% for key, value in api_config_flags.iteritems() -%}
{{ key }} = {{ value }}
{% endfor -%}
{% endif -%}
{% include "parts/rabbitmq" %}
{% if rabbitmq_host or rabbitmq_hosts -%}