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:
parent
6c661bc615
commit
339241fbb1
|
@ -76,6 +76,7 @@ if $is_controller{
|
||||||
# Params used by the script.
|
# Params used by the script.
|
||||||
$rabbit = hiera('rabbit')
|
$rabbit = hiera('rabbit')
|
||||||
$rabbitmq_port = hiera('amqp_port', '5673')
|
$rabbitmq_port = hiera('amqp_port', '5673')
|
||||||
|
$rabbitmq_host = hiera('internal_address')
|
||||||
$rabbitmq_user = 'nova'
|
$rabbitmq_user = 'nova'
|
||||||
$rabbitmq_password = $rabbit['password']
|
$rabbitmq_password = $rabbit['password']
|
||||||
$wait_delay = 30
|
$wait_delay = 30
|
||||||
|
|
|
@ -40,9 +40,9 @@ if hiera('deployment_mode') =~ /^ha_/ {
|
||||||
$ha_deployment = false
|
$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':
|
class { 'lma_collector::notifications::controller':
|
||||||
host => '127.0.0.1',
|
host => hiera('internal_address'),
|
||||||
port => hiera('amqp_port', '5673'),
|
port => hiera('amqp_port', '5673'),
|
||||||
user => $rabbitmq_user,
|
user => $rabbitmq_user,
|
||||||
password => $rabbit['password'],
|
password => $rabbit['password'],
|
||||||
|
|
|
@ -16,7 +16,7 @@ def errback(exc, interval):
|
||||||
print_message("{0}, retry in {1} seconds".format(exc, interval))
|
print_message("{0}, retry in {1} seconds".format(exc, interval))
|
||||||
|
|
||||||
# First we need to check the connection
|
# 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)
|
conn.ensure_connection(errback, interval_start=<%= @wait_delay %>, interval_step=0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue