Deprecate rabbitmq connection parameters

The rabbitmq connection parameters have been deprecated in favor of the
transport_url setting.

Change-Id: I7ae5c5a2584eab063b8e647dc34008ac71bd04e0
Related-Bug: #1625198
This commit is contained in:
Alex Schultz 2016-11-08 12:47:03 -07:00
parent 95db61d071
commit b865dffaa6
3 changed files with 54 additions and 36 deletions

View File

@ -31,31 +31,6 @@
# (Optional) Configure the timeout (in seconds) for rpc responses
# Defaults to $::os_service_default.
#
# [*rabbit_host*]
# (Optional) IP or hostname of the rabbit server.
# Defaults to $::os_service_default.
#
# [*rabbit_port*]
# (Optional) Port of the rabbit server.
# Defaults to $::os_service_default.
#
# [*rabbit_hosts*]
# (Optional) Array of host:port (used with HA queues).
# If defined, will remove rabbit_host & rabbit_port parameters from config
# Defaults to $::os_service_default.
#
# [*rabbit_userid*]
# (Optional) User to connect to the rabbit server.
# Defaults to $::os_service_default.
#
# [*rabbit_password*]
# (Optional) Password to connect to the rabbit_server.
# Defaults to $::os_service_default.
#
# [*rabbit_virtual_host*]
# (Optional) Virtual_host to use.
# Defaults to $::os_service_default.
#
# [*rabbit_ha_queues*]
# (optional) Use HA queues in RabbitMQ (x-ha-policy: all).
# Defaults to $::os_service_default.
@ -300,6 +275,33 @@
# take for evaluation.
# Defaults to $::os_service_default.
#
# === DEPRECATED PARAMETERS
#
# [*rabbit_host*]
# (Optional) IP or hostname of the rabbit server.
# Defaults to $::os_service_default.
#
# [*rabbit_port*]
# (Optional) Port of the rabbit server.
# Defaults to $::os_service_default.
#
# [*rabbit_hosts*]
# (Optional) Array of host:port (used with HA queues).
# If defined, will remove rabbit_host & rabbit_port parameters from config
# Defaults to $::os_service_default.
#
# [*rabbit_userid*]
# (Optional) User to connect to the rabbit server.
# Defaults to $::os_service_default.
#
# [*rabbit_password*]
# (Optional) Password to connect to the rabbit_server.
# Defaults to $::os_service_default.
#
# [*rabbit_virtual_host*]
# (Optional) Virtual_host to use.
# Defaults to $::os_service_default.
#
class heat(
$package_ensure = 'present',
$debug = undef,
@ -308,12 +310,6 @@ class heat(
$default_transport_url = $::os_service_default,
$rpc_backend = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$rabbit_host = $::os_service_default,
$rabbit_port = $::os_service_default,
$rabbit_hosts = $::os_service_default,
$rabbit_userid = $::os_service_default,
$rabbit_password = $::os_service_default,
$rabbit_virtual_host = $::os_service_default,
$rabbit_ha_queues = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = 0,
$rabbit_heartbeat_rate = $::os_service_default,
@ -368,6 +364,13 @@ class heat(
$auth_strategy = 'keystone',
$yaql_memory_quota = $::os_service_default,
$yaql_limit_iterators = $::os_service_default,
# DEPRECATED PARAMETERS
$rabbit_host = $::os_service_default,
$rabbit_port = $::os_service_default,
$rabbit_hosts = $::os_service_default,
$rabbit_userid = $::os_service_default,
$rabbit_password = $::os_service_default,
$rabbit_virtual_host = $::os_service_default,
) {
include ::heat::logging
@ -379,6 +382,17 @@ class heat(
include ::heat::keystone::authtoken
}
if !is_service_default($rabbit_host) or
!is_service_default($rabbit_hosts) or
!is_service_default($rabbit_password) or
!is_service_default($rabbit_port) or
!is_service_default($rabbit_userid) or
!is_service_default($rabbit_virtual_host) {
warning("heat::rabbit_host, heat::rabbit_hosts, heat::rabbit_password, \
heat::rabbit_port, heat::rabbit_userid and heat::rabbit_virtual_host are \
deprecated. Please use heat::default_transport_url instead.")
}
package { 'heat-common':
ensure => $package_ensure,
name => $::heat::params::common_package_name,

View File

@ -0,0 +1,6 @@
---
deprecations:
- heat::rabbit_host, heat::rabbit_hosts, heat::rabbit_password,
heat::rabbit_port, heat::rabbit_userid and
heat::rabbit_virtual_host are deprecated.
heat::default_transport_url should be used instead.

View File

@ -32,11 +32,9 @@ describe 'basic heat' do
}
# heat resources
class { '::heat':
rabbit_userid => 'heat',
rabbit_password => 'an_even_bigger_secret',
rabbit_host => '127.0.0.1',
database_connection => 'mysql+pymysql://heat:a_big_secret@127.0.0.1/heat?charset=utf8',
debug => true,
default_transport_url => 'rabbit://heat:an_even_bigger_secret@127.0.0.1:5672/',
database_connection => 'mysql+pymysql://heat:a_big_secret@127.0.0.1/heat?charset=utf8',
debug => true,
}
class { '::heat::db::mysql':
password => 'a_big_secret',