From 597194a4199b34e1389b26f080ae1fefccbca924 Mon Sep 17 00:00:00 2001 From: Brent Eagles Date: Fri, 14 Oct 2016 16:35:44 -0230 Subject: Add port to rabbitmq node ip list We use the rabbit_hosts configuration for most of our services but we haven't been adding the configured port. This patch appends the IP port used provided to the service's heat template to the IPs in the list. Note: while we could use the value set for the rabbitmq server in rabbitmq::port, it doesn't allow for dealing with SSL. This also is also backwards compatible with the RabbitClientPort parameters used in the heat templates. Change-Id: I0000f039144a6b0e98c0a148dc69324f60db3d8b Closes-Bug: #1633580 --- manifests/profile/base/aodh.pp | 6 +++++- manifests/profile/base/ceilometer.pp | 11 ++++++++--- manifests/profile/base/cinder.pp | 7 ++++++- manifests/profile/base/glance/api.pp | 8 +++++++- manifests/profile/base/heat.pp | 7 ++++++- manifests/profile/base/ironic.pp | 7 ++++++- manifests/profile/base/keystone.pp | 7 ++++++- manifests/profile/base/manila.pp | 7 ++++++- manifests/profile/base/mistral.pp | 7 ++++++- manifests/profile/base/neutron.pp | 7 ++++++- manifests/profile/base/nova.pp | 7 ++++++- manifests/profile/base/sahara.pp | 7 ++++++- spec/classes/tripleo_profile_base_aodh_spec.rb | 4 ++-- spec/classes/tripleo_profile_base_ceilometer_spec.rb | 2 +- 14 files changed, 77 insertions(+), 17 deletions(-) diff --git a/manifests/profile/base/aodh.pp b/manifests/profile/base/aodh.pp index 49a543a..02c1d07 100644 --- a/manifests/profile/base/aodh.pp +++ b/manifests/profile/base/aodh.pp @@ -31,11 +31,15 @@ # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') # +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('aodh::rabbit_port', 5672) class tripleo::profile::base::aodh ( $step = hiera('step'), $bootstrap_node = hiera('bootstrap_nodeid', undef), $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('aodh::rabbit_port', 5672), ) { if $::hostname == downcase($bootstrap_node) { @@ -46,7 +50,7 @@ class tripleo::profile::base::aodh ( if $step >= 4 or ($step >= 3 and $sync_db) { class { '::aodh' : - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } include ::aodh::auth include ::aodh::config diff --git a/manifests/profile/base/ceilometer.pp b/manifests/profile/base/ceilometer.pp index aaf904f..959d86c 100644 --- a/manifests/profile/base/ceilometer.pp +++ b/manifests/profile/base/ceilometer.pp @@ -26,15 +26,20 @@ # [*rabbit_hosts*] # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') +# +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('ceilometer::rabbit_port', 5672) class tripleo::profile::base::ceilometer ( - $step = hiera('step'), - $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $step = hiera('step'), + $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('ceilometer::rabbit_port', 5672), ) { if $step >= 3 { class { '::ceilometer' : - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } include ::ceilometer::config } diff --git a/manifests/profile/base/cinder.pp b/manifests/profile/base/cinder.pp index 510ea40..9f7c453 100644 --- a/manifests/profile/base/cinder.pp +++ b/manifests/profile/base/cinder.pp @@ -33,12 +33,17 @@ # [*rabbit_hosts*] # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') +# +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('cinder::rabbit_port', 5672) 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_port = hiera('cinder::rabbit_port', 5672), ) { if $::hostname == downcase($bootstrap_node) { $sync_db = true @@ -48,7 +53,7 @@ class tripleo::profile::base::cinder ( if $step >= 4 or ($step >= 3 and $sync_db) { class { '::cinder' : - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } include ::cinder::config } diff --git a/manifests/profile/base/glance/api.pp b/manifests/profile/base/glance/api.pp index ecffd7f..f3db396 100644 --- a/manifests/profile/base/glance/api.pp +++ b/manifests/profile/base/glance/api.pp @@ -30,11 +30,16 @@ # [*rabbit_hosts*] # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') +# +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('glance::notify::rabbitmq::rabbit_port', 5672) class tripleo::profile::base::glance::api ( $glance_backend = downcase(hiera('glance_backend', 'swift')), $step = hiera('step'), $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('glance::notify::rabbitmq::rabbit_port', 5672), ) { if $step >= 4 { @@ -53,8 +58,9 @@ class tripleo::profile::base::glance::api ( class { '::glance::api': stores => $glance_store, } + class { '::glance::notify::rabbitmq' : - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } include join(['::glance::backend::', $glance_backend]) } diff --git a/manifests/profile/base/heat.pp b/manifests/profile/base/heat.pp index 2035a4f..abb9f76 100644 --- a/manifests/profile/base/heat.pp +++ b/manifests/profile/base/heat.pp @@ -38,6 +38,10 @@ # [*rabbit_hosts*] # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') +# +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('heat::rabbit_port', 5672) class tripleo::profile::base::heat ( $bootstrap_node = downcase(hiera('bootstrap_nodeid')), @@ -45,6 +49,7 @@ class tripleo::profile::base::heat ( $notification_driver = 'messaging', $step = hiera('step'), $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('heat::rabbit_port', 5672), ) { # Domain resources will be created at step5 on the node running keystone.pp # configure heat.conf at step3 and 4 but actually create the domain later. @@ -59,7 +64,7 @@ class tripleo::profile::base::heat ( if $step >= 4 { class { '::heat' : notification_driver => $notification_driver, - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } include ::heat::config include ::heat::cors diff --git a/manifests/profile/base/ironic.pp b/manifests/profile/base/ironic.pp index c4e525a..e63e4c6 100644 --- a/manifests/profile/base/ironic.pp +++ b/manifests/profile/base/ironic.pp @@ -29,11 +29,16 @@ # [*rabbit_hosts*] # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') +# +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('ironic::rabbit_port', 5672) class tripleo::profile::base::ironic ( $bootstrap_node = hiera('bootstrap_nodeid', undef), $step = hiera('step'), $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('ironic::rabbit_port', 5672), ) { # Database is accessed by both API and conductor, hence it's here. if $::hostname == downcase($bootstrap_node) { @@ -45,7 +50,7 @@ class tripleo::profile::base::ironic ( if $step >= 4 or ($step >= 3 and $sync_db) { class { '::ironic': sync_db => $sync_db, - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } include ::ironic::cors diff --git a/manifests/profile/base/keystone.pp b/manifests/profile/base/keystone.pp index 846296e..fbccdda 100644 --- a/manifests/profile/base/keystone.pp +++ b/manifests/profile/base/keystone.pp @@ -34,12 +34,17 @@ # [*rabbit_hosts*] # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') +# +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('keystone::rabbit_port', 5672) class tripleo::profile::base::keystone ( $bootstrap_node = hiera('bootstrap_nodeid', undef), $manage_db_purge = hiera('keystone_enable_db_purge', true), $step = hiera('step'), $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('keystone::rabbit_port', 5672), ) { if $::hostname == downcase($bootstrap_node) { $sync_db = true @@ -57,7 +62,7 @@ class tripleo::profile::base::keystone ( class { '::keystone': sync_db => $sync_db, enable_bootstrap => $sync_db, - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } include ::keystone::config diff --git a/manifests/profile/base/manila.pp b/manifests/profile/base/manila.pp index 5210284..393dd52 100644 --- a/manifests/profile/base/manila.pp +++ b/manifests/profile/base/manila.pp @@ -29,11 +29,16 @@ # [*rabbit_hosts*] # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') +# +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('manila::rabbit_port', 5672) class tripleo::profile::base::manila ( $bootstrap_node = hiera('bootstrap_nodeid', undef), $step = hiera('step'), $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('manila::rabbit_port', 5672), ) { if $::hostname == downcase($bootstrap_node) { $sync_db = true @@ -43,7 +48,7 @@ class tripleo::profile::base::manila ( if $step >= 4 or ($step >= 3 and $sync_db) { class { '::manila' : - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } include ::manila::config } diff --git a/manifests/profile/base/mistral.pp b/manifests/profile/base/mistral.pp index 9986d22..dcd9d0b 100644 --- a/manifests/profile/base/mistral.pp +++ b/manifests/profile/base/mistral.pp @@ -30,11 +30,16 @@ # [*rabbit_hosts*] # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') +# +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('mistral::rabbit_port', 5672) class tripleo::profile::base::mistral ( $bootstrap_node = hiera('bootstrap_nodeid', undef), $step = hiera('step'), $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('mistral::rabbit_port', 5672), ) { if $::hostname == downcase($bootstrap_node) { $sync_db = true @@ -44,7 +49,7 @@ class tripleo::profile::base::mistral ( if $step >= 4 or ($step >= 3 and $sync_db) { class { '::mistral': - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } include ::mistral::config include ::mistral::client diff --git a/manifests/profile/base/neutron.pp b/manifests/profile/base/neutron.pp index 90a5c23..53df3d9 100644 --- a/manifests/profile/base/neutron.pp +++ b/manifests/profile/base/neutron.pp @@ -25,14 +25,19 @@ # [*rabbit_hosts*] # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') +# +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('neutron::rabbit_port', 5672 class tripleo::profile::base::neutron ( $step = hiera('step'), $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('neutron::rabbit_port', 5672), ) { if $step >= 3 { class { '::neutron' : - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } include ::neutron::config } diff --git a/manifests/profile/base/nova.pp b/manifests/profile/base/nova.pp index 74f0460..b397802 100644 --- a/manifests/profile/base/nova.pp +++ b/manifests/profile/base/nova.pp @@ -41,6 +41,10 @@ # [*rabbit_hosts*] # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') +# +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('nova::rabbit_port', 5672) class tripleo::profile::base::nova ( $bootstrap_node = hiera('bootstrap_nodeid', undef), @@ -49,6 +53,7 @@ class tripleo::profile::base::nova ( $nova_compute_enabled = false, $step = hiera('step'), $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('nova::rabbit_port', 5672), ) { if $::hostname == downcase($bootstrap_node) { $sync_db = true @@ -64,7 +69,7 @@ class tripleo::profile::base::nova ( if hiera('step') >= 4 or (hiera('step') >= 3 and $sync_db) { class { '::nova' : - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } include ::nova::config class { '::nova::cache': diff --git a/manifests/profile/base/sahara.pp b/manifests/profile/base/sahara.pp index cf0ee90..c034628 100644 --- a/manifests/profile/base/sahara.pp +++ b/manifests/profile/base/sahara.pp @@ -29,11 +29,16 @@ # [*rabbit_hosts*] # list of the rabbbit host IPs # Defaults to hiera('rabbitmq_node_ips') +# +# [*rabbit_port*] +# IP port for rabbitmq service +# Defaults to hiera('sahara::rabbit_port', 5672) class tripleo::profile::base::sahara ( $bootstrap_node = hiera('bootstrap_nodeid', undef), $step = hiera('step'), $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('sahara::rabbit_port', 5672), ) { if $::hostname == downcase($bootstrap_node) { $sync_db = true @@ -44,7 +49,7 @@ class tripleo::profile::base::sahara ( if $step >= 4 or ($step >= 3 and $sync_db){ class { '::sahara': sync_db => $sync_db, - rabbit_hosts => $rabbit_hosts, + rabbit_hosts => suffix($rabbit_hosts, ":${rabbit_port}") } } } diff --git a/spec/classes/tripleo_profile_base_aodh_spec.rb b/spec/classes/tripleo_profile_base_aodh_spec.rb index 10c17eb..dd6554e 100644 --- a/spec/classes/tripleo_profile_base_aodh_spec.rb +++ b/spec/classes/tripleo_profile_base_aodh_spec.rb @@ -39,7 +39,7 @@ describe 'tripleo::profile::base::aodh' do it 'should trigger complete configuration' do is_expected.to contain_class('aodh').with( - :rabbit_hosts => params[:rabbit_hosts] + :rabbit_hosts => params[:rabbit_hosts].map { |h| h + ":5672" } ) is_expected.to contain_class('aodh::auth') is_expected.to contain_class('aodh::config') @@ -72,7 +72,7 @@ describe 'tripleo::profile::base::aodh' do it 'should trigger aodh configuration without mysql grant' do is_expected.to contain_class('aodh').with( - :rabbit_hosts => params[:rabbit_hosts] + :rabbit_hosts => params[:rabbit_hosts].map { |h| h + ":5672" } ) is_expected.to contain_class('aodh::auth') is_expected.to contain_class('aodh::config') diff --git a/spec/classes/tripleo_profile_base_ceilometer_spec.rb b/spec/classes/tripleo_profile_base_ceilometer_spec.rb index 73fb41b..5510f4b 100644 --- a/spec/classes/tripleo_profile_base_ceilometer_spec.rb +++ b/spec/classes/tripleo_profile_base_ceilometer_spec.rb @@ -35,7 +35,7 @@ describe 'tripleo::profile::base::ceilometer' do it 'should trigger complete configuration' do is_expected.to contain_class('ceilometer').with( - :rabbit_hosts => params[:rabbit_hosts] + :rabbit_hosts => params[:rabbit_hosts].map{ |h| h + ':5672' } ) is_expected.to contain_class('ceilometer::config') end -- cgit 1.2.3-korg