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) <email@daviey.com>
This commit is contained in:
Dave Walker (Daviey) 2016-06-26 01:07:28 +01:00
parent b6e51e9531
commit 2a2a86ac43
2 changed files with 4 additions and 2 deletions

View File

@ -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 %}

View File

@ -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 %}