diff --git a/hooks/nova-ceilometer-relation-changed b/hooks/nova-ceilometer-relation-changed new file mode 120000 index 0000000..3ba0bde --- /dev/null +++ b/hooks/nova-ceilometer-relation-changed @@ -0,0 +1 @@ +nova_compute_hooks.py \ No newline at end of file diff --git a/hooks/nova-ceilometer-relation-joined b/hooks/nova-ceilometer-relation-joined new file mode 120000 index 0000000..3ba0bde --- /dev/null +++ b/hooks/nova-ceilometer-relation-joined @@ -0,0 +1 @@ +nova_compute_hooks.py \ No newline at end of file diff --git a/hooks/nova_compute_hooks.py b/hooks/nova_compute_hooks.py index 890ed90..e4db254 100755 --- a/hooks/nova_compute_hooks.py +++ b/hooks/nova_compute_hooks.py @@ -209,6 +209,12 @@ def upgrade_charm(): amqp_joined(relation_id=r_id) +@hooks.hook('nova-ceilometer-relation-changed') +@restart_on_change(restart_map()) +def nova_ceilometer_relation_changed(): + CONFIGS.writeall() + + def main(): try: hooks.execute(sys.argv) diff --git a/hooks/nova_compute_utils.py b/hooks/nova_compute_utils.py index 8416db4..5f90af6 100644 --- a/hooks/nova_compute_utils.py +++ b/hooks/nova_compute_utils.py @@ -69,7 +69,12 @@ BASE_RESOURCE_MAP = { context.OSConfigFlagContext(), CloudComputeContext(), NovaComputeLibvirtContext(), - NovaComputeCephContext()], + NovaComputeCephContext(), + context.SubordinateConfigContext( + interface='nova-ceilometer', + service='nova', + config_file=NOVA_CONF, + )], }, } diff --git a/metadata.yaml b/metadata.yaml index 6e9534d..488528a 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -6,7 +6,7 @@ description: | addition to its "native" API (the OpenStack API), it also supports the Amazon EC2 API. categories: - - openstack + - openstack provides: cloud-compute: interface: nova-compute @@ -22,6 +22,9 @@ requires: nrpe-external-master: interface: nrpe-external-master scope: container + nova-ceilometer: + interface: nova-ceilometer + scope: container peers: compute-peer: interface: nova diff --git a/templates/havana/nova.conf b/templates/havana/nova.conf index a92d16b..d00ee00 100644 --- a/templates/havana/nova.conf +++ b/templates/havana/nova.conf @@ -84,3 +84,9 @@ volume_api_class = nova.volume.cinder.API {% if live_migration_uri -%} live_migration_uri = {{ live_migration_uri }} {% endif -%} + +{% if sections and 'DEFAULT' in sections -%} +{% for key, value in sections['DEFAULT'] -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif -%} \ No newline at end of file