diff --git a/config.yaml b/config.yaml index aeb292d9..aa6177d6 100644 --- a/config.yaml +++ b/config.yaml @@ -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 diff --git a/hooks/glance_utils.py b/hooks/glance_utils.py index 1cc1067a..99b81f99 100755 --- a/hooks/glance_utils.py +++ b/hooks/glance_utils.py @@ -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, { diff --git a/templates/icehouse/glance-api.conf b/templates/icehouse/glance-api.conf index 809aa01c..39328689 100644 --- a/templates/icehouse/glance-api.conf +++ b/templates/icehouse/glance-api.conf @@ -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 -%} diff --git a/templates/icehouse/glance-registry.conf b/templates/icehouse/glance-registry.conf index f7dde09f..af7fa344 100644 --- a/templates/icehouse/glance-registry.conf +++ b/templates/icehouse/glance-registry.conf @@ -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" %} diff --git a/templates/juno/glance-api.conf b/templates/juno/glance-api.conf index 2887520b..5289d86f 100644 --- a/templates/juno/glance-api.conf +++ b/templates/juno/glance-api.conf @@ -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 -%}