Use internal_address to connect to RabbitMQ

RabbitMQ is now listenning on the internal address so we need to use
this address instead of 127.0.0.1.

Closes-Bug: #1493853
Change-Id: I0c42dc8538254c519cf4acacb7c445f403348799
This commit is contained in:
Guillaume Thouvenin 2015-09-09 16:08:20 +02:00
parent 6c661bc615
commit 339241fbb1
3 changed files with 4 additions and 3 deletions

View File

@ -76,6 +76,7 @@ if $is_controller{
# Params used by the script.
$rabbit = hiera('rabbit')
$rabbitmq_port = hiera('amqp_port', '5673')
$rabbitmq_host = hiera('internal_address')
$rabbitmq_user = 'nova'
$rabbitmq_password = $rabbit['password']
$wait_delay = 30

View File

@ -40,9 +40,9 @@ if hiera('deployment_mode') =~ /^ha_/ {
$ha_deployment = false
}
# OpenStack notifcations are always useful for indexation and metrics collection
# OpenStack notifications are always useful for indexation and metrics collection
class { 'lma_collector::notifications::controller':
host => '127.0.0.1',
host => hiera('internal_address'),
port => hiera('amqp_port', '5673'),
user => $rabbitmq_user,
password => $rabbit['password'],

View File

@ -16,7 +16,7 @@ def errback(exc, interval):
print_message("{0}, retry in {1} seconds".format(exc, interval))
# First we need to check the connection
with Connection('amqp://<%= @rabbitmq_user %>:<%= @rabbitmq_password %>@localhost:<%= @rabbitmq_port %>//') as conn:
with Connection('amqp://<%= @rabbitmq_user %>:<%= @rabbitmq_password %>@<%= @rabbitmq_host %>:<%= @rabbitmq_port %>//') as conn:
conn.ensure_connection(errback, interval_start=<%= @wait_delay %>, interval_step=0)