From 2a2a86ac43f86ee698ce080486612984f67d9ea0 Mon Sep 17 00:00:00 2001 From: "Dave Walker (Daviey)" Date: Sun, 26 Jun 2016 01:07:28 +0100 Subject: [PATCH] glance-*, fix rabbit config with ceilometer Currently, if ceilometer is enabled with glance then the rabbitmq is non-functional, causing various glance failures including image upload. This is caused because: The generated config fails to have a carriage return at the end of the rabbit_host line, causing the following line to be added to this entry. rabbit_host is used rather than rabbit_hosts, where the fromer expects a string, rather than the list that is provided. This also adds rabbit HA support, to be in-line with the other services using rabbitmq. This is resolved, by pushing the rabbit_hosts entry to be last, meaning that a carriage return is not required. Change-Id: I89f26d542565b98025fd9b84fc4beb5cbed364e5 Closes-Bug: 1596244 Signed-off-by: Dave Walker (Daviey) --- ansible/roles/glance/templates/glance-api.conf.j2 | 3 ++- ansible/roles/glance/templates/glance-registry.conf.j2 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ansible/roles/glance/templates/glance-api.conf.j2 b/ansible/roles/glance/templates/glance-api.conf.j2 index 8ece2f91a2..f81a7296b6 100644 --- a/ansible/roles/glance/templates/glance-api.conf.j2 +++ b/ansible/roles/glance/templates/glance-api.conf.j2 @@ -55,9 +55,10 @@ filesystem_store_datadir = /var/lib/glance/images/ driver = messagingv2 [oslo_messaging_rabbit] -rabbit_host = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} rabbit_userid = {{ rabbitmq_user }} rabbit_password = {{ rabbitmq_password }} +rabbit_ha_queues = true +rabbit_hosts = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} {% else %} driver = noop {% endif %} diff --git a/ansible/roles/glance/templates/glance-registry.conf.j2 b/ansible/roles/glance/templates/glance-registry.conf.j2 index 49d35ee025..55146ac870 100644 --- a/ansible/roles/glance/templates/glance-registry.conf.j2 +++ b/ansible/roles/glance/templates/glance-registry.conf.j2 @@ -34,9 +34,10 @@ flavor = keystone driver = messagingv2 [oslo_messaging_rabbit] -rabbit_host = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} rabbit_userid = {{ rabbitmq_user }} rabbit_password = {{ rabbitmq_password }} +rabbit_ha_queues = true +rabbit_hosts = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} {% else %} driver = noop {% endif %}