From f45e18144dcdcf4713b40c3c9f71c1af7802ed06 Mon Sep 17 00:00:00 2001 From: Bertrand Lallau Date: Fri, 10 Mar 2017 22:23:58 +0100 Subject: [PATCH] Nova oslo_messaging_notifications config error With the following configuration in globals.yml enable_ceilometer="no" enable_designate="no" enable_searchlight="yes" nova.conf is generated like following: [oslo_messaging_notifications] driver = messagingv2 topics = topics value is missing. Change-Id: I27145c0da8b864b2614091933c33d83bdec8b9be Closes-Bug: #1671935 Co-Authored-By: Jeffrey Zhang --- ansible/roles/nova/defaults/main.yml | 11 +++++++++++ ansible/roles/nova/templates/nova.conf.j2 | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ansible/roles/nova/defaults/main.yml b/ansible/roles/nova/defaults/main.yml index d2edb81c5e..df2ad6710f 100644 --- a/ansible/roles/nova/defaults/main.yml +++ b/ansible/roles/nova/defaults/main.yml @@ -236,3 +236,14 @@ openstack_placement_auth: "{{ openstack_auth }}" nova_ssh_port: "8022" + +#################### +# Notification +#################### +nova_notification_topics: + - name: notifications + enabled: "{{ enable_ceilometer | bool or enable_searchlight | bool }}" + - name: notifications_designate + enabled: "{{ enable_designate | bool }}" + +nova_enabled_notification_topics: "{{ nova_notification_topics | selectattr('enabled', 'equalto', true) | list }}" diff --git a/ansible/roles/nova/templates/nova.conf.j2 b/ansible/roles/nova/templates/nova.conf.j2 index f7d8a373f9..cd87b42a31 100644 --- a/ansible/roles/nova/templates/nova.conf.j2 +++ b/ansible/roles/nova/templates/nova.conf.j2 @@ -201,10 +201,9 @@ rbd_secret_uuid = {{ rbd_secret_uuid }} compute = auto [oslo_messaging_notifications] -{% if enable_ceilometer | bool or enable_searchlight | bool or enable_designate | bool %} +{% if nova_enabled_notification_topics %} driver = messagingv2 -{% set topics=["notifications" if enable_ceilometer | bool else "", "notifications_designate" if enable_designate | bool else ""] %} -topics = {{ topics|reject("equalto", "")|list|join(",") }} +topics = {{ nova_enabled_notification_topics | map(attribute='name') | join(',') }} {% else %} driver = noop {% endif %}