Use FQDNs for the services' RabbitMQ configuration

This replaces the services' IP-based RabbitMQ configuration and uses
FQDNs instead.

Change-Id: I2be81aecacf50839a029533247981f5edf59cb7f
This commit is contained in:
Juan Antonio Osorio Robles 2016-11-28 08:34:20 +02:00
parent 3246b2b383
commit 91597fc569
22 changed files with 62 additions and 62 deletions

View File

@ -28,8 +28,8 @@
# Defaults to hiera('bootstrap_nodeid')
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -38,7 +38,7 @@
class tripleo::profile::base::aodh (
$step = hiera('step'),
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('aodh::rabbit_port', 5672),
) {
@ -49,7 +49,7 @@ class tripleo::profile::base::aodh (
}
if $step >= 4 or ($step >= 3 and $sync_db) {
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::aodh' :
rabbit_hosts => $rabbit_endpoints,
}

View File

@ -24,8 +24,8 @@
# Defaults to hiera('step')
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -33,12 +33,12 @@
class tripleo::profile::base::ceilometer (
$step = hiera('step'),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('ceilometer::rabbit_port', 5672),
) {
if $step >= 3 {
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::ceilometer' :
rabbit_hosts => $rabbit_endpoints,
}

View File

@ -31,8 +31,8 @@
# Defaults to hiera('step')
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -42,7 +42,7 @@ class tripleo::profile::base::cinder (
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$cinder_enable_db_purge = true,
$step = hiera('step'),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('cinder::rabbit_port', 5672),
) {
if $::hostname == downcase($bootstrap_node) {
@ -52,7 +52,7 @@ class tripleo::profile::base::cinder (
}
if $step >= 4 or ($step >= 3 and $sync_db) {
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::cinder' :
rabbit_hosts => $rabbit_endpoints,
}

View File

@ -32,8 +32,8 @@
# Defaults to hiera('step')
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -43,7 +43,7 @@ class tripleo::profile::base::glance::api (
$glance_backend = downcase(hiera('glance_backend', 'swift')),
$glance_nfs_enabled = false,
$step = hiera('step'),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('glance::notify::rabbitmq::rabbit_port', 5672),
) {
@ -67,7 +67,7 @@ class tripleo::profile::base::glance::api (
class { '::glance::api':
stores => $glance_store,
}
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::glance::notify::rabbitmq' :
rabbit_hosts => $rabbit_endpoints,
}

View File

@ -36,8 +36,8 @@
# Defaults to hiera('step')
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -48,7 +48,7 @@ class tripleo::profile::base::heat (
$manage_db_purge = hiera('heat_enable_db_purge', true),
$notification_driver = 'messaging',
$step = hiera('step'),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('heat::rabbit_port', 5672),
) {
# Domain resources will be created at step5 on the node running keystone.pp
@ -62,7 +62,7 @@ class tripleo::profile::base::heat (
}
if $step >= 4 {
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::heat' :
notification_driver => $notification_driver,
rabbit_hosts => $rabbit_endpoints,

View File

@ -27,8 +27,8 @@
# Defaults to hiera('step')
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -37,7 +37,7 @@
class tripleo::profile::base::ironic (
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$step = hiera('step'),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('ironic::rabbit_port', 5672),
) {
# Database is accessed by both API and conductor, hence it's here.
@ -48,7 +48,7 @@ class tripleo::profile::base::ironic (
}
if $step >= 4 or ($step >= 3 and $sync_db) {
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::ironic':
sync_db => $sync_db,
rabbit_hosts => $rabbit_endpoints,

View File

@ -78,8 +78,8 @@
#
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -102,7 +102,7 @@ class tripleo::profile::base::keystone (
$heat_admin_user = undef,
$manage_db_purge = hiera('keystone_enable_db_purge', true),
$public_endpoint_network = hiera('keystone_public_api_network', undef),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('keystone::rabbit_port', 5672),
$step = hiera('step'),
) {
@ -142,7 +142,7 @@ class tripleo::profile::base::keystone (
}
if $step >= 4 or ( $step >= 3 and $sync_db ) {
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::keystone':
sync_db => $sync_db,
enable_bootstrap => $sync_db,

View File

@ -27,8 +27,8 @@
# Defaults to hiera('step')
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -37,7 +37,7 @@
class tripleo::profile::base::manila (
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$step = hiera('step'),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('manila::rabbit_port', 5672),
) {
if $::hostname == downcase($bootstrap_node) {
@ -47,7 +47,7 @@ class tripleo::profile::base::manila (
}
if $step >= 4 or ($step >= 3 and $sync_db) {
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::manila' :
rabbit_hosts => $rabbit_endpoints,
}

View File

@ -28,8 +28,8 @@
# Defaults to hiera('step')
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -38,7 +38,7 @@
class tripleo::profile::base::mistral (
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$step = hiera('step'),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('mistral::rabbit_port', 5672),
) {
if $::hostname == downcase($bootstrap_node) {
@ -48,7 +48,7 @@ class tripleo::profile::base::mistral (
}
if $step >= 4 or ($step >= 3 and $sync_db) {
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::mistral':
rabbit_hosts => $rabbit_endpoints,
}

View File

@ -23,8 +23,8 @@
# Defaults to hiera('step')
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -32,11 +32,11 @@
class tripleo::profile::base::neutron (
$step = hiera('step'),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('neutron::rabbit_port', 5672),
) {
if $step >= 3 {
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::neutron' :
rabbit_hosts => $rabbit_endpoints,
}

View File

@ -39,8 +39,8 @@
# Defaults to hiera('step')
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -52,7 +52,7 @@ class tripleo::profile::base::nova (
$manage_migration = false,
$nova_compute_enabled = false,
$step = hiera('step'),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('nova::rabbit_port', 5672),
) {
if $::hostname == downcase($bootstrap_node) {
@ -68,7 +68,7 @@ class tripleo::profile::base::nova (
}
if hiera('step') >= 4 or (hiera('step') >= 3 and $sync_db) {
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::nova' :
rabbit_hosts => $rabbit_endpoints,
}

View File

@ -27,8 +27,8 @@
# Defaults to hiera('step')
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -37,7 +37,7 @@
class tripleo::profile::base::sahara (
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$step = hiera('step'),
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('sahara::rabbit_port', 5672),
) {
if $::hostname == downcase($bootstrap_node) {
@ -47,7 +47,7 @@ class tripleo::profile::base::sahara (
}
if $step >= 4 or ($step >= 3 and $sync_db){
$rabbit_endpoints = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::sahara':
sync_db => $sync_db,
rabbit_hosts => $rabbit_endpoints,

View File

@ -32,8 +32,8 @@
# Defaults to 11211
#
# [*rabbit_hosts*]
# list of the rabbbit host IPs
# Defaults to hiera('rabbitmq_node_ips')
# list of the rabbbit host fqdns
# Defaults to hiera('rabbitmq_node_names')
#
# [*rabbit_port*]
# IP port for rabbitmq service
@ -43,7 +43,7 @@ class tripleo::profile::base::swift::proxy (
$step = hiera('step'),
$memcache_servers = hiera('memcached_node_ips'),
$memcache_port = 11211,
$rabbit_hosts = hiera('rabbitmq_node_ips', undef),
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('swift::proxy::ceilometer::rabbit_port', 5672),
) {
if $step >= 4 {
@ -63,7 +63,7 @@ class tripleo::profile::base::swift::proxy (
include ::swift::proxy::tempurl
include ::swift::proxy::formpost
include ::swift::proxy::bulk
$swift_rabbit_hosts = suffix(any2array(normalize_ip_for_uri($rabbit_hosts)), ":${rabbit_port}")
$swift_rabbit_hosts = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::swift::proxy::ceilometer':
rabbit_hosts => $swift_rabbit_hosts,
}

View File

@ -19,7 +19,7 @@ require 'spec_helper'
describe 'tripleo::profile::base::aodh::api' do
shared_examples_for 'tripleo::profile::base::aodh::api' do
let(:pre_condition) do
"class { '::tripleo::profile::base::aodh': step => #{params[:step]}, rabbit_hosts => ['127.0.0.1'] }"
"class { '::tripleo::profile::base::aodh': step => #{params[:step]}, rabbit_hosts => ['localhost.localdomain'] }"
end
context 'with step less than 4' do

View File

@ -19,7 +19,7 @@ require 'spec_helper'
describe 'tripleo::profile::base::aodh::evaluator' do
shared_examples_for 'tripleo::profile::base::aodh::evaluator' do
let(:pre_condition) do
"class { '::tripleo::profile::base::aodh': step => #{params[:step]}, rabbit_hosts => ['127.0.0.1'] }"
"class { '::tripleo::profile::base::aodh': step => #{params[:step]}, rabbit_hosts => ['localhost.localdomain'] }"
end
context 'with step less than 4' do

View File

@ -19,7 +19,7 @@ require 'spec_helper'
describe 'tripleo::profile::base::aodh::listener' do
shared_examples_for 'tripleo::profile::base::aodh::listener' do
let(:pre_condition) do
"class { '::tripleo::profile::base::aodh': step => #{params[:step]}, rabbit_hosts => ['127.0.0.1'] }"
"class { '::tripleo::profile::base::aodh': step => #{params[:step]}, rabbit_hosts => ['localhost.localdomain'] }"
end
context 'with step less than 4' do

View File

@ -19,7 +19,7 @@ require 'spec_helper'
describe 'tripleo::profile::base::aodh::notifier' do
shared_examples_for 'tripleo::profile::base::aodh::notifier' do
let(:pre_condition) do
"class { '::tripleo::profile::base::aodh': step => #{params[:step]}, rabbit_hosts => ['127.0.0.1'] }"
"class { '::tripleo::profile::base::aodh': step => #{params[:step]}, rabbit_hosts => ['localhost.localdomain'] }"
end
context 'with step less than 4' do

View File

@ -34,7 +34,7 @@ describe 'tripleo::profile::base::aodh' do
let(:params) { {
:step => 3,
:bootstrap_node => 'node.example.com',
:rabbit_hosts => ['127.0.0.1', '127.0.0.2']
:rabbit_hosts => ['localhost1.localdomain', 'localhost2.localdomain']
} }
it 'should trigger complete configuration' do
@ -67,7 +67,7 @@ describe 'tripleo::profile::base::aodh' do
let(:params) { {
:step => 4,
:bootstrap_node => 'somethingelse.example.com',
:rabbit_hosts => ['127.0.0.1', '127.0.0.2']
:rabbit_hosts => ['localhost1.localdomain', 'localhost2.localdomain']
} }
it 'should trigger aodh configuration without mysql grant' do

View File

@ -19,7 +19,7 @@ require 'spec_helper'
describe 'tripleo::profile::base::ceilometer::api' do
shared_examples_for 'tripleo::profile::base::ceilometer::api' do
let(:pre_condition) do
"class { '::tripleo::profile::base::ceilometer': step => #{params[:step]}, rabbit_hosts => ['127.0.0.1'] }"
"class { '::tripleo::profile::base::ceilometer': step => #{params[:step]}, rabbit_hosts => ['localhost.localdomain'] }"
end
context 'with step less than 4' do

View File

@ -19,7 +19,7 @@ require 'spec_helper'
describe 'tripleo::profile::base::ceilometer::collector' do
shared_examples_for 'tripleo::profile::base::ceilometer::collector' do
let(:pre_condition) do
"class { '::tripleo::profile::base::ceilometer': step => #{params[:step]}, rabbit_hosts => ['127.0.0.1'] }"
"class { '::tripleo::profile::base::ceilometer': step => #{params[:step]}, rabbit_hosts => ['localhost.localdomain'] }"
end
context 'with step 3 on bootstrap node with mongodb' do

View File

@ -19,7 +19,7 @@ require 'spec_helper'
describe 'tripleo::profile::base::ceilometer::expirer' do
shared_examples_for 'tripleo::profile::base::ceilometer::expirer' do
let(:pre_condition) do
"class { '::tripleo::profile::base::ceilometer': step => #{params[:step]}, rabbit_hosts => ['127.0.0.1'] }"
"class { '::tripleo::profile::base::ceilometer': step => #{params[:step]}, rabbit_hosts => ['localhost.localdomain'] }"
end
context 'with step less than 4' do

View File

@ -30,7 +30,7 @@ describe 'tripleo::profile::base::ceilometer' do
context 'with step 3' do
let(:params) { {
:step => 3,
:rabbit_hosts => ['127.0.0.1', '127.0.0.2']
:rabbit_hosts => ['localhost1.localdomain', 'localhost2.localdomain']
} }
it 'should trigger complete configuration' do