Add config-flags support

This change adds support for the config-flags user setting which
allows arbitrary config to be injected into the default section of
the heat.conf

Change-Id: I1e0866e9a2954773b42bd7be60c56da36b66f20b
Closes-Bug: 1658985
This commit is contained in:
Liam Young 2017-02-02 10:36:07 +00:00
parent f7dc1f111c
commit 2d34278ba0
6 changed files with 28 additions and 2 deletions

View File

@ -172,6 +172,12 @@ options:
order for this charm to function correctly, the privacy extension must be
disabled and a non-temporary address must be configured/available on
your network interface.
config-flags:
type: string
default:
description: |
Comma-separated list of key=value config flags. These values will be
placed in the heat.conf [DEFAULT] section.
# HA configuration settings
dns-ha:
type: boolean
@ -224,4 +230,3 @@ options:
The CPU core multiplier to use when configuring worker processes for
Heat. By default, the number of workers for each daemon is set to
twice the number of CPU cores a service unit has.

View File

@ -109,7 +109,8 @@ CONFIG_FILES = OrderedDict([
context.LogLevelContext(),
context.WorkerConfigContext(),
context.BindHostContext(),
context.MemcacheContext()],
context.MemcacheContext(),
context.OSConfigFlagContext()],
}),
(HEAT_API_PASTE, {
'services': [s for s in BASE_SERVICES if 'api' in s],

View File

@ -13,6 +13,11 @@ deferred_auth_method=password
host=heat
auth_encryption_key={{ encryption_key }}
num_engine_workers = {{ workers }}
{% if user_config_flags -%}
{% for key, value in user_config_flags.iteritems() -%}
{{ key }} = {{ value }}
{% endfor -%}
{% endif -%}
{% if database_host -%}
# < Icehouse db config

View File

@ -14,6 +14,11 @@ stack_domain_admin = heat_domain_admin
stack_domain_admin_password = {{ heat_domain_admin_passwd }}
stack_user_domain_name = heat
num_engine_workers = {{ workers }}
{% if user_config_flags -%}
{% for key, value in user_config_flags.iteritems() -%}
{{ key }} = {{ value }}
{% endfor -%}
{% endif -%}
{% if auth_host -%}
[keystone_authtoken]

View File

@ -14,6 +14,11 @@ stack_domain_admin = heat_domain_admin
stack_domain_admin_password = {{ heat_domain_admin_passwd }}
stack_user_domain_name = heat
num_engine_workers = {{ workers }}
{% if user_config_flags -%}
{% for key, value in user_config_flags.iteritems() -%}
{{ key }} = {{ value }}
{% endfor -%}
{% endif -%}
{% if auth_host -%}
[keystone_authtoken]

View File

@ -14,6 +14,11 @@ stack_domain_admin = heat_domain_admin
stack_domain_admin_password = {{ heat_domain_admin_passwd }}
stack_user_domain_name = heat
num_engine_workers = {{ workers }}
{% if user_config_flags -%}
{% for key, value in user_config_flags.iteritems() -%}
{{ key }} = {{ value }}
{% endfor -%}
{% endif -%}
{% if auth_host -%}
{% include "section-keystone-authtoken-mitaka" %}