Merge "Switch Heat to $::os_service_default - part 1"
This commit is contained in:
commit
e328ef849d
@ -10,28 +10,28 @@
|
|||||||
#
|
#
|
||||||
# [*database_idle_timeout*]
|
# [*database_idle_timeout*]
|
||||||
# Timeout when db connections should be reaped.
|
# Timeout when db connections should be reaped.
|
||||||
# (Optional) Defaults to 3600.
|
# (Optional) Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*database_min_pool_size*]
|
# [*database_min_pool_size*]
|
||||||
# Minimum number of SQL connections to keep open in a pool.
|
# Minimum number of SQL connections to keep open in a pool.
|
||||||
# (Optional) Defaults to 1.
|
# (Optional) Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*database_max_pool_size*]
|
# [*database_max_pool_size*]
|
||||||
# Maximum number of SQL connections to keep open in a pool.
|
# Maximum number of SQL connections to keep open in a pool.
|
||||||
# (Optional) Defaults to 10.
|
# (Optional) Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*database_max_retries*]
|
# [*database_max_retries*]
|
||||||
# Maximum db connection retries during startup.
|
# Maximum db connection retries during startup.
|
||||||
# Setting -1 implies an infinite retry count.
|
# Setting -1 implies an infinite retry count.
|
||||||
# (Optional) Defaults to 10.
|
# (Optional) Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*database_retry_interval*]
|
# [*database_retry_interval*]
|
||||||
# Interval between retries of opening a sql connection.
|
# Interval between retries of opening a sql connection.
|
||||||
# (Optional) Defaults to 10.
|
# (Optional) Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*database_max_overflow*]
|
# [*database_max_overflow*]
|
||||||
# If set, use this value for max_overflow with sqlalchemy.
|
# If set, use this value for max_overflow with sqlalchemy.
|
||||||
# (Optional) Defaults to 20.
|
# (Optional) Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*sync_db*]
|
# [*sync_db*]
|
||||||
# (Optional) Run db sync on nodes after connection setting has been set.
|
# (Optional) Run db sync on nodes after connection setting has been set.
|
||||||
@ -39,12 +39,12 @@
|
|||||||
#
|
#
|
||||||
class heat::db (
|
class heat::db (
|
||||||
$database_connection = 'sqlite:////var/lib/heat/heat.sqlite',
|
$database_connection = 'sqlite:////var/lib/heat/heat.sqlite',
|
||||||
$database_idle_timeout = 3600,
|
$database_idle_timeout = $::os_service_default,
|
||||||
$database_min_pool_size = 1,
|
$database_min_pool_size = $::os_service_default,
|
||||||
$database_max_pool_size = 10,
|
$database_max_pool_size = $::os_service_default,
|
||||||
$database_max_retries = 10,
|
$database_max_retries = $::os_service_default,
|
||||||
$database_retry_interval = 10,
|
$database_retry_interval = $::os_service_default,
|
||||||
$database_max_overflow = 20,
|
$database_max_overflow = $::os_service_default,
|
||||||
$sync_db = true,
|
$sync_db = true,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -64,47 +64,44 @@ class heat::db (
|
|||||||
validate_re($database_connection_real,
|
validate_re($database_connection_real,
|
||||||
'(sqlite|mysql|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
'(sqlite|mysql|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||||
|
|
||||||
if $database_connection_real {
|
case $database_connection_real {
|
||||||
case $database_connection_real {
|
/^mysql:\/\//: {
|
||||||
/^mysql:\/\//: {
|
$backend_package = false
|
||||||
$backend_package = false
|
require 'mysql::bindings'
|
||||||
require 'mysql::bindings'
|
require 'mysql::bindings::python'
|
||||||
require 'mysql::bindings::python'
|
|
||||||
}
|
|
||||||
/^postgresql:\/\//: {
|
|
||||||
$backend_package = false
|
|
||||||
require 'postgresql::lib::python'
|
|
||||||
}
|
|
||||||
/^sqlite:\/\//: {
|
|
||||||
$backend_package = $::heat::params::sqlite_package_name
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
fail('Unsupported backend configured')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/^postgresql:\/\//: {
|
||||||
if $backend_package and !defined(Package[$backend_package]) {
|
$backend_package = false
|
||||||
package {'heat-backend-package':
|
require 'postgresql::lib::python'
|
||||||
ensure => present,
|
|
||||||
name => $backend_package,
|
|
||||||
tag => 'openstack',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/^sqlite:\/\//: {
|
||||||
heat_config {
|
$backend_package = $::heat::params::sqlite_package_name
|
||||||
'database/connection': value => $database_connection_real, secret => true;
|
|
||||||
'database/idle_timeout': value => $database_idle_timeout_real;
|
|
||||||
'database/min_pool_size': value => $database_min_pool_size_real;
|
|
||||||
'database/max_retries': value => $database_max_retries_real;
|
|
||||||
'database/retry_interval': value => $database_retry_interval_real;
|
|
||||||
'database/max_pool_size': value => $database_max_pool_size_real;
|
|
||||||
'database/max_overflow': value => $database_max_overflow_real;
|
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
if $sync_db_real {
|
fail('Unsupported backend configured')
|
||||||
include ::heat::db::sync
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if $backend_package and !defined(Package[$backend_package]) {
|
||||||
|
package {'heat-backend-package':
|
||||||
|
ensure => present,
|
||||||
|
name => $backend_package,
|
||||||
|
tag => 'openstack',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
heat_config {
|
||||||
|
'database/connection': value => $database_connection_real, secret => true;
|
||||||
|
'database/idle_timeout': value => $database_idle_timeout_real;
|
||||||
|
'database/min_pool_size': value => $database_min_pool_size_real;
|
||||||
|
'database/max_retries': value => $database_max_retries_real;
|
||||||
|
'database/retry_interval': value => $database_retry_interval_real;
|
||||||
|
'database/max_pool_size': value => $database_max_pool_size_real;
|
||||||
|
'database/max_overflow': value => $database_max_overflow_real;
|
||||||
|
}
|
||||||
|
|
||||||
|
if $sync_db_real {
|
||||||
|
include ::heat::db::sync
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#
|
#
|
||||||
# [*rpc_response_timeout*]
|
# [*rpc_response_timeout*]
|
||||||
# (Optional) Configure the timeout (in seconds) for rpc responses
|
# (Optional) Configure the timeout (in seconds) for rpc responses
|
||||||
# Defaults to 60 seconds
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*rabbit_host*]
|
# [*rabbit_host*]
|
||||||
# (Optional) IP or hostname of the rabbit server.
|
# (Optional) IP or hostname of the rabbit server.
|
||||||
@ -44,7 +44,7 @@
|
|||||||
#
|
#
|
||||||
# [*rabbit_userid*]
|
# [*rabbit_userid*]
|
||||||
# (Optional) User to connect to the rabbit server.
|
# (Optional) User to connect to the rabbit server.
|
||||||
# Defaults to 'guest'
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*rabbit_password*]
|
# [*rabbit_password*]
|
||||||
# (Optional) Password to connect to the rabbit_server.
|
# (Optional) Password to connect to the rabbit_server.
|
||||||
@ -52,7 +52,7 @@
|
|||||||
#
|
#
|
||||||
# [*rabbit_virtual_host*]
|
# [*rabbit_virtual_host*]
|
||||||
# (Optional) Virtual_host to use.
|
# (Optional) Virtual_host to use.
|
||||||
# Defaults to '/'
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*rabbit_ha_queues*]
|
# [*rabbit_ha_queues*]
|
||||||
# (optional) Use HA queues in RabbitMQ (x-ha-policy: all).
|
# (optional) Use HA queues in RabbitMQ (x-ha-policy: all).
|
||||||
@ -71,7 +71,7 @@
|
|||||||
# check the heartbeat on RabbitMQ connection. (i.e. rabbit_heartbeat_rate=2
|
# check the heartbeat on RabbitMQ connection. (i.e. rabbit_heartbeat_rate=2
|
||||||
# when rabbit_heartbeat_timeout_threshold=60, the heartbeat will be checked
|
# when rabbit_heartbeat_timeout_threshold=60, the heartbeat will be checked
|
||||||
# every 30 seconds.
|
# every 30 seconds.
|
||||||
# Defaults to 2
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*rabbit_use_ssl*]
|
# [*rabbit_use_ssl*]
|
||||||
# (Optional) Connect over SSL for RabbitMQ.
|
# (Optional) Connect over SSL for RabbitMQ.
|
||||||
@ -79,21 +79,21 @@
|
|||||||
#
|
#
|
||||||
# [*kombu_ssl_ca_certs*]
|
# [*kombu_ssl_ca_certs*]
|
||||||
# (Optional) SSL certification authority file (valid only if SSL enabled).
|
# (Optional) SSL certification authority file (valid only if SSL enabled).
|
||||||
# Defaults to undef
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*kombu_ssl_certfile*]
|
# [*kombu_ssl_certfile*]
|
||||||
# (Optional) SSL cert file (valid only if SSL enabled).
|
# (Optional) SSL cert file (valid only if SSL enabled).
|
||||||
# Defaults to undef
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*kombu_ssl_keyfile*]
|
# [*kombu_ssl_keyfile*]
|
||||||
# (Optional) SSL key file (valid only if SSL enabled).
|
# (Optional) SSL key file (valid only if SSL enabled).
|
||||||
# Defaults to undef
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*kombu_ssl_version*]
|
# [*kombu_ssl_version*]
|
||||||
# (Optional) SSL version to use (valid only if SSL enabled).
|
# (Optional) SSL version to use (valid only if SSL enabled).
|
||||||
# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be
|
# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be
|
||||||
# available on some distributions.
|
# available on some distributions.
|
||||||
# Defaults to 'TLSv1'
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*amqp_durable_queues*]
|
# [*amqp_durable_queues*]
|
||||||
# (Optional) Use durable queues in amqp.
|
# (Optional) Use durable queues in amqp.
|
||||||
@ -191,12 +191,12 @@
|
|||||||
# (optional) Specifies the Authentication method.
|
# (optional) Specifies the Authentication method.
|
||||||
# Set to 'standalone' to get Heat to work with a remote OpenStack
|
# Set to 'standalone' to get Heat to work with a remote OpenStack
|
||||||
# Tested versions include 0.9 and 2.2
|
# Tested versions include 0.9 and 2.2
|
||||||
# Defaults to undef
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*region_name*]
|
# [*region_name*]
|
||||||
# (Optional) Region name for services. This is the
|
# (Optional) Region name for services. This is the
|
||||||
# default region name that heat talks to service endpoints on.
|
# default region name that heat talks to service endpoints on.
|
||||||
# Defaults to undef
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*instance_user*]
|
# [*instance_user*]
|
||||||
# (Optional) The default user for new instances. Although heat claims that
|
# (Optional) The default user for new instances. Although heat claims that
|
||||||
@ -207,11 +207,11 @@
|
|||||||
#
|
#
|
||||||
# [*enable_stack_adopt*]
|
# [*enable_stack_adopt*]
|
||||||
# (Optional) Enable the stack-adopt feature.
|
# (Optional) Enable the stack-adopt feature.
|
||||||
# Defaults to undef
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*enable_stack_abandon*]
|
# [*enable_stack_abandon*]
|
||||||
# (Optional) Enable the stack-abandon feature.
|
# (Optional) Enable the stack-abandon feature.
|
||||||
# Defaults to undef
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*sync_db*]
|
# [*sync_db*]
|
||||||
# (Optional) Run db sync on nodes after connection setting has been set.
|
# (Optional) Run db sync on nodes after connection setting has been set.
|
||||||
@ -249,29 +249,29 @@ class heat(
|
|||||||
$keystone_password = false,
|
$keystone_password = false,
|
||||||
$keystone_ec2_uri = 'http://127.0.0.1:5000/v2.0/ec2tokens',
|
$keystone_ec2_uri = 'http://127.0.0.1:5000/v2.0/ec2tokens',
|
||||||
$rpc_backend = 'rabbit',
|
$rpc_backend = 'rabbit',
|
||||||
$rpc_response_timeout = 60,
|
$rpc_response_timeout = $::os_service_default,
|
||||||
$rabbit_host = '127.0.0.1',
|
$rabbit_host = '127.0.0.1',
|
||||||
$rabbit_port = 5672,
|
$rabbit_port = 5672,
|
||||||
$rabbit_hosts = undef,
|
$rabbit_hosts = undef,
|
||||||
$rabbit_userid = 'guest',
|
$rabbit_userid = $::os_service_default,
|
||||||
$rabbit_password = '',
|
$rabbit_password = '',
|
||||||
$rabbit_virtual_host = '/',
|
$rabbit_virtual_host = $::os_service_default,
|
||||||
$rabbit_ha_queues = undef,
|
$rabbit_ha_queues = undef,
|
||||||
$rabbit_heartbeat_timeout_threshold = 0,
|
$rabbit_heartbeat_timeout_threshold = 0,
|
||||||
$rabbit_heartbeat_rate = 2,
|
$rabbit_heartbeat_rate = $::os_service_default,
|
||||||
$rabbit_use_ssl = false,
|
$rabbit_use_ssl = false,
|
||||||
$kombu_ssl_ca_certs = undef,
|
$kombu_ssl_ca_certs = $::os_service_default,
|
||||||
$kombu_ssl_certfile = undef,
|
$kombu_ssl_certfile = $::os_service_default,
|
||||||
$kombu_ssl_keyfile = undef,
|
$kombu_ssl_keyfile = $::os_service_default,
|
||||||
$kombu_ssl_version = 'TLSv1',
|
$kombu_ssl_version = $::os_service_default,
|
||||||
$amqp_durable_queues = false,
|
$amqp_durable_queues = false,
|
||||||
$qpid_hostname = 'localhost',
|
$qpid_hostname = 'localhost',
|
||||||
$qpid_port = 5672,
|
$qpid_port = 5672,
|
||||||
$qpid_username = 'guest',
|
$qpid_username = 'guest',
|
||||||
$qpid_password = 'guest',
|
$qpid_password = 'guest',
|
||||||
$qpid_heartbeat = 60,
|
$qpid_heartbeat = $::os_service_default,
|
||||||
$qpid_protocol = 'tcp',
|
$qpid_protocol = $::os_service_default,
|
||||||
$qpid_tcp_nodelay = true,
|
$qpid_tcp_nodelay = $::os_service_default,
|
||||||
$qpid_reconnect = true,
|
$qpid_reconnect = true,
|
||||||
$qpid_reconnect_timeout = 0,
|
$qpid_reconnect_timeout = 0,
|
||||||
$qpid_reconnect_limit = 0,
|
$qpid_reconnect_limit = 0,
|
||||||
@ -288,10 +288,10 @@ class heat(
|
|||||||
$database_min_pool_size = undef,
|
$database_min_pool_size = undef,
|
||||||
$database_max_pool_size = undef,
|
$database_max_pool_size = undef,
|
||||||
$database_max_overflow = undef,
|
$database_max_overflow = undef,
|
||||||
$flavor = undef,
|
$flavor = $::os_service_default,
|
||||||
$region_name = undef,
|
$region_name = $::os_service_default,
|
||||||
$enable_stack_adopt = undef,
|
$enable_stack_adopt = $::os_service_default,
|
||||||
$enable_stack_abandon = undef,
|
$enable_stack_abandon = $::os_service_default,
|
||||||
$sync_db = undef,
|
$sync_db = undef,
|
||||||
# Deprecated parameters
|
# Deprecated parameters
|
||||||
$mysql_module = undef,
|
$mysql_module = undef,
|
||||||
@ -307,16 +307,17 @@ class heat(
|
|||||||
include ::heat::deps
|
include ::heat::deps
|
||||||
include ::heat::params
|
include ::heat::params
|
||||||
|
|
||||||
if $kombu_ssl_ca_certs and !$rabbit_use_ssl {
|
if (!is_service_default($kombu_ssl_ca_certs)) and !$rabbit_use_ssl {
|
||||||
fail('The kombu_ssl_ca_certs parameter requires rabbit_use_ssl to be set to true')
|
fail('The kombu_ssl_ca_certs parameter requires rabbit_use_ssl to be set to true')
|
||||||
}
|
}
|
||||||
if $kombu_ssl_certfile and !$rabbit_use_ssl {
|
if (!is_service_default($kombu_ssl_certfile)) and !$rabbit_use_ssl {
|
||||||
fail('The kombu_ssl_certfile parameter requires rabbit_use_ssl to be set to true')
|
fail('The kombu_ssl_certfile parameter requires rabbit_use_ssl to be set to true')
|
||||||
}
|
}
|
||||||
if $kombu_ssl_keyfile and !$rabbit_use_ssl {
|
if (!is_service_default($kombu_ssl_keyfile)) and !$rabbit_use_ssl {
|
||||||
fail('The kombu_ssl_keyfile parameter requires rabbit_use_ssl to be set to true')
|
fail('The kombu_ssl_keyfile parameter requires rabbit_use_ssl to be set to true')
|
||||||
}
|
}
|
||||||
if ($kombu_ssl_certfile and !$kombu_ssl_keyfile) or ($kombu_ssl_keyfile and !$kombu_ssl_certfile) {
|
if ((!is_service_default($kombu_ssl_certfile)) and is_service_default($kombu_ssl_keyfile))
|
||||||
|
or ((!is_service_default($kombu_ssl_keyfile)) and is_service_default($kombu_ssl_certfile)) {
|
||||||
fail('The kombu_ssl_certfile and kombu_ssl_keyfile parameters must be used together')
|
fail('The kombu_ssl_certfile and kombu_ssl_keyfile parameters must be used together')
|
||||||
}
|
}
|
||||||
if $mysql_module {
|
if $mysql_module {
|
||||||
@ -363,41 +364,10 @@ class heat(
|
|||||||
'oslo_messaging_rabbit/heartbeat_rate': value => $rabbit_heartbeat_rate;
|
'oslo_messaging_rabbit/heartbeat_rate': value => $rabbit_heartbeat_rate;
|
||||||
'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl;
|
'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl;
|
||||||
'oslo_messaging_rabbit/amqp_durable_queues': value => $amqp_durable_queues;
|
'oslo_messaging_rabbit/amqp_durable_queues': value => $amqp_durable_queues;
|
||||||
}
|
'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs;
|
||||||
|
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $kombu_ssl_certfile;
|
||||||
if $rabbit_use_ssl {
|
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $kombu_ssl_keyfile;
|
||||||
|
'oslo_messaging_rabbit/kombu_ssl_version': value => $kombu_ssl_version;
|
||||||
if $kombu_ssl_ca_certs {
|
|
||||||
heat_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs; }
|
|
||||||
} else {
|
|
||||||
heat_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
|
|
||||||
}
|
|
||||||
|
|
||||||
if $kombu_ssl_certfile or $kombu_ssl_keyfile {
|
|
||||||
heat_config {
|
|
||||||
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $kombu_ssl_certfile;
|
|
||||||
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $kombu_ssl_keyfile;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
heat_config {
|
|
||||||
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
|
|
||||||
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $kombu_ssl_version {
|
|
||||||
heat_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $kombu_ssl_version; }
|
|
||||||
} else {
|
|
||||||
heat_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
heat_config {
|
|
||||||
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
|
|
||||||
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
|
|
||||||
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
|
|
||||||
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -481,26 +451,25 @@ class heat(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_service_default($enable_stack_adopt)) {
|
||||||
|
validate_bool($enable_stack_adopt)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_service_default($enable_stack_abandon)) {
|
||||||
|
validate_bool($enable_stack_abandon)
|
||||||
|
}
|
||||||
|
|
||||||
heat_config {
|
heat_config {
|
||||||
'DEFAULT/rpc_backend' : value => $rpc_backend;
|
'DEFAULT/rpc_backend': value => $rpc_backend;
|
||||||
'DEFAULT/rpc_response_timeout' : value => $rpc_response_timeout;
|
'DEFAULT/rpc_response_timeout': value => $rpc_response_timeout;
|
||||||
'ec2authtoken/auth_uri' : value => $keystone_ec2_uri;
|
'DEFAULT/region_name_for_services': value => $region_name;
|
||||||
'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant;
|
'DEFAULT/enable_stack_abandon': value => $enable_stack_abandon;
|
||||||
'keystone_authtoken/admin_user' : value => $keystone_user;
|
'DEFAULT/enable_stack_adopt': value => $enable_stack_adopt;
|
||||||
'keystone_authtoken/admin_password' : value => $keystone_password, secret => true;
|
'ec2authtoken/auth_uri': value => $keystone_ec2_uri;
|
||||||
}
|
'keystone_authtoken/admin_tenant_name': value => $keystone_tenant;
|
||||||
|
'keystone_authtoken/admin_user': value => $keystone_user;
|
||||||
if $flavor {
|
'keystone_authtoken/admin_password': value => $keystone_password, secret => true;
|
||||||
heat_config { 'paste_deploy/flavor': value => $flavor; }
|
'paste_deploy/flavor': value => $flavor;
|
||||||
} else {
|
|
||||||
heat_config { 'paste_deploy/flavor': ensure => absent; }
|
|
||||||
}
|
|
||||||
|
|
||||||
# region name
|
|
||||||
if $region_name {
|
|
||||||
heat_config { 'DEFAULT/region_name_for_services': value => $region_name; }
|
|
||||||
} else {
|
|
||||||
heat_config { 'DEFAULT/region_name_for_services': ensure => absent; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# instance_user
|
# instance_user
|
||||||
@ -513,17 +482,4 @@ class heat(
|
|||||||
heat_config { 'DEFAULT/instance_user': ensure => absent; }
|
heat_config { 'DEFAULT/instance_user': ensure => absent; }
|
||||||
}
|
}
|
||||||
|
|
||||||
if $enable_stack_adopt != undef {
|
|
||||||
validate_bool($enable_stack_adopt)
|
|
||||||
heat_config { 'DEFAULT/enable_stack_adopt': value => $enable_stack_adopt; }
|
|
||||||
} else {
|
|
||||||
heat_config { 'DEFAULT/enable_stack_adopt': ensure => absent; }
|
|
||||||
}
|
|
||||||
|
|
||||||
if $enable_stack_abandon != undef {
|
|
||||||
validate_bool($enable_stack_abandon)
|
|
||||||
heat_config { 'DEFAULT/enable_stack_abandon': value => $enable_stack_abandon; }
|
|
||||||
} else {
|
|
||||||
heat_config { 'DEFAULT/enable_stack_abandon': ensure => absent; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -5,24 +5,24 @@
|
|||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# [*verbose*]
|
# [*verbose*]
|
||||||
# (Optional) Should the daemons log verbose messages
|
# (Optional) Should the daemons log verbose messages.
|
||||||
# Defaults to 'false'
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*debug*]
|
# [*debug*]
|
||||||
# (Optional) Should the daemons log debug messages
|
# (Optional) Should the daemons log debug messages.
|
||||||
# Defaults to 'false'
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*use_syslog*]
|
# [*use_syslog*]
|
||||||
# (Optional) Use syslog for logging.
|
# (Optional) Use syslog for logging.
|
||||||
# Defaults to 'false'
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*use_stderr*]
|
# [*use_stderr*]
|
||||||
# (optional) Use stderr for logging
|
# (optional) Use stderr for logging.
|
||||||
# Defaults to 'true'
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*log_facility*]
|
# [*log_facility*]
|
||||||
# (Optional) Syslog facility to receive log lines.
|
# (Optional) Syslog facility to receive log lines.
|
||||||
# Defaults to 'LOG_USER'
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*log_dir*]
|
# [*log_dir*]
|
||||||
# (optional) Directory where logs should be stored.
|
# (optional) Directory where logs should be stored.
|
||||||
@ -31,34 +31,34 @@
|
|||||||
#
|
#
|
||||||
# [*logging_context_format_string*]
|
# [*logging_context_format_string*]
|
||||||
# (optional) Format string to use for log messages with context.
|
# (optional) Format string to use for log messages with context.
|
||||||
# Defaults to undef.
|
# Defaults to $::os_service_default
|
||||||
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
|
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
|
||||||
# [%(request_id)s %(user_identity)s] %(instance)s%(message)s'
|
# [%(request_id)s %(user_identity)s] %(instance)s%(message)s'
|
||||||
#
|
#
|
||||||
# [*logging_default_format_string*]
|
# [*logging_default_format_string*]
|
||||||
# (optional) Format string to use for log messages without context.
|
# (optional) Format string to use for log messages without context.
|
||||||
# Defaults to undef.
|
# Defaults to $::os_service_default.
|
||||||
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
|
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
|
||||||
# [-] %(instance)s%(message)s'
|
# [-] %(instance)s%(message)s'
|
||||||
#
|
#
|
||||||
# [*logging_debug_format_suffix*]
|
# [*logging_debug_format_suffix*]
|
||||||
# (optional) Formatted data to append to log format when level is DEBUG.
|
# (optional) Formatted data to append to log format when level is DEBUG.
|
||||||
# Defaults to undef.
|
# Defaults to $::os_service_default.
|
||||||
# Example: '%(funcName)s %(pathname)s:%(lineno)d'
|
# Example: '%(funcName)s %(pathname)s:%(lineno)d'
|
||||||
#
|
#
|
||||||
# [*logging_exception_prefix*]
|
# [*logging_exception_prefix*]
|
||||||
# (optional) Prefix each line of exception output with this format.
|
# (optional) Prefix each line of exception output with this format.
|
||||||
# Defaults to undef.
|
# Defaults to $::os_service_default.
|
||||||
# Example: '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s'
|
# Example: '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s'
|
||||||
#
|
#
|
||||||
# [*log_config_append*]
|
# [*log_config_append*]
|
||||||
# The name of an additional logging configuration file.
|
# The name of an additional logging configuration file.
|
||||||
# Defaults to undef.
|
# Defaults to $::os_service_default.
|
||||||
# See https://docs.python.org/2/howto/logging.html
|
# See https://docs.python.org/2/howto/logging.html
|
||||||
#
|
#
|
||||||
# [*default_log_levels*]
|
# [*default_log_levels*]
|
||||||
# (optional) Hash of logger (keys) and level (values) pairs.
|
# (optional) Hash of logger (keys) and level (values) pairs.
|
||||||
# Defaults to undef.
|
# Defaults to $::os_service_default.
|
||||||
# Example:
|
# Example:
|
||||||
# {'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
|
# {'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
|
||||||
# 'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
|
# 'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
|
||||||
@ -67,47 +67,47 @@
|
|||||||
#
|
#
|
||||||
# [*publish_errors*]
|
# [*publish_errors*]
|
||||||
# (optional) Publish error events (boolean value).
|
# (optional) Publish error events (boolean value).
|
||||||
# Defaults to undef (false if unconfigured).
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*fatal_deprecations*]
|
# [*fatal_deprecations*]
|
||||||
# (optional) Make deprecations fatal (boolean value)
|
# (optional) Make deprecations fatal (boolean value).
|
||||||
# Defaults to undef (false if unconfigured).
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*instance_format*]
|
# [*instance_format*]
|
||||||
# (optional) If an instance is passed with the log message, format it
|
# (optional) If an instance is passed with the log message, format it
|
||||||
# like this (string value).
|
# like this (string value).
|
||||||
# Defaults to undef.
|
# Defaults to $::os_service_default.
|
||||||
# Example: '[instance: %(uuid)s] '
|
# Example: '[instance: %(uuid)s] '
|
||||||
#
|
#
|
||||||
# [*instance_uuid_format*]
|
# [*instance_uuid_format*]
|
||||||
# (optional) If an instance UUID is passed with the log message, format
|
# (optional) If an instance UUID is passed with the log message, format
|
||||||
# It like this (string value).
|
# It like this (string value).
|
||||||
# Defaults to undef.
|
# Defaults to $::os_service_default.
|
||||||
# Example: instance_uuid_format='[instance: %(uuid)s] '
|
# Example: instance_uuid_format='[instance: %(uuid)s] '
|
||||||
|
|
||||||
# [*log_date_format*]
|
# [*log_date_format*]
|
||||||
# (optional) Format string for %%(asctime)s in log records.
|
# (optional) Format string for %%(asctime)s in log records.
|
||||||
# Defaults to undef.
|
# Defaults to $::os_service_default.
|
||||||
# Example: 'Y-%m-%d %H:%M:%S'
|
# Example: 'Y-%m-%d %H:%M:%S'
|
||||||
#
|
#
|
||||||
class heat::logging(
|
class heat::logging(
|
||||||
$use_syslog = false,
|
$use_syslog = $::os_service_default,
|
||||||
$use_stderr = true,
|
$use_stderr = $::os_service_default,
|
||||||
$log_facility = 'LOG_USER',
|
$log_facility = $::os_service_default,
|
||||||
$log_dir = '/var/log/heat',
|
$log_dir = '/var/log/heat',
|
||||||
$verbose = false,
|
$verbose = $::os_service_default,
|
||||||
$debug = false,
|
$debug = $::os_service_default,
|
||||||
$logging_context_format_string = undef,
|
$logging_context_format_string = $::os_service_default,
|
||||||
$logging_default_format_string = undef,
|
$logging_default_format_string = $::os_service_default,
|
||||||
$logging_debug_format_suffix = undef,
|
$logging_debug_format_suffix = $::os_service_default,
|
||||||
$logging_exception_prefix = undef,
|
$logging_exception_prefix = $::os_service_default,
|
||||||
$log_config_append = undef,
|
$log_config_append = $::os_service_default,
|
||||||
$default_log_levels = undef,
|
$default_log_levels = $::os_service_default,
|
||||||
$publish_errors = undef,
|
$publish_errors = $::os_service_default,
|
||||||
$fatal_deprecations = undef,
|
$fatal_deprecations = $::os_service_default,
|
||||||
$instance_format = undef,
|
$instance_format = $::os_service_default,
|
||||||
$instance_uuid_format = undef,
|
$instance_uuid_format = $::os_service_default,
|
||||||
$log_date_format = undef,
|
$log_date_format = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::heat::deps
|
include ::heat::deps
|
||||||
@ -121,139 +121,30 @@ class heat::logging(
|
|||||||
$verbose_real = pick($::heat::verbose,$verbose)
|
$verbose_real = pick($::heat::verbose,$verbose)
|
||||||
$debug_real = pick($::heat::debug,$debug)
|
$debug_real = pick($::heat::debug,$debug)
|
||||||
|
|
||||||
heat_config {
|
if is_service_default($default_log_levels) {
|
||||||
'DEFAULT/debug' : value => $debug_real;
|
$default_log_levels_real = $default_log_levels
|
||||||
'DEFAULT/verbose' : value => $verbose_real;
|
} else {
|
||||||
'DEFAULT/use_stderr' : value => $use_stderr_real;
|
$default_log_levels_real = join(sort(join_keys_to_values($default_log_levels, '=')), ',')
|
||||||
'DEFAULT/use_syslog' : value => $use_syslog_real;
|
|
||||||
'DEFAULT/log_dir' : value => $log_dir_real;
|
|
||||||
'DEFAULT/syslog_log_facility': value => $log_facility_real;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if $logging_context_format_string {
|
heat_config {
|
||||||
heat_config {
|
'DEFAULT/debug': value => $debug_real;
|
||||||
'DEFAULT/logging_context_format_string' :
|
'DEFAULT/verbose': value => $verbose_real;
|
||||||
value => $logging_context_format_string;
|
'DEFAULT/use_stderr': value => $use_stderr_real;
|
||||||
}
|
'DEFAULT/use_syslog': value => $use_syslog_real;
|
||||||
}
|
'DEFAULT/log_dir': value => $log_dir_real;
|
||||||
else {
|
'DEFAULT/syslog_log_facility': value => $log_facility_real;
|
||||||
heat_config {
|
'DEFAULT/default_log_levels': value => $default_log_levels_real;
|
||||||
'DEFAULT/logging_context_format_string' : ensure => absent;
|
'DEFAULT/logging_context_format_string': value => $logging_context_format_string;
|
||||||
}
|
'DEFAULT/logging_default_format_string': value => $logging_default_format_string;
|
||||||
}
|
'DEFAULT/logging_debug_format_suffix': value => $logging_debug_format_suffix;
|
||||||
|
'DEFAULT/logging_exception_prefix': value => $logging_exception_prefix;
|
||||||
if $logging_default_format_string {
|
'DEFAULT/log_config_append': value => $log_config_append;
|
||||||
heat_config {
|
'DEFAULT/publish_errors': value => $publish_errors;
|
||||||
'DEFAULT/logging_default_format_string' :
|
'DEFAULT/fatal_deprecations': value => $fatal_deprecations;
|
||||||
value => $logging_default_format_string;
|
'DEFAULT/instance_format': value => $instance_format;
|
||||||
}
|
'DEFAULT/instance_uuid_format': value => $instance_uuid_format;
|
||||||
}
|
'DEFAULT/log_date_format': value => $log_date_format;
|
||||||
else {
|
}
|
||||||
heat_config {
|
|
||||||
'DEFAULT/logging_default_format_string' : ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $logging_debug_format_suffix {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/logging_debug_format_suffix' :
|
|
||||||
value => $logging_debug_format_suffix;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/logging_debug_format_suffix' : ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $logging_exception_prefix {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/logging_exception_prefix' : value => $logging_exception_prefix;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/logging_exception_prefix' : ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $log_config_append {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/log_config_append' : value => $log_config_append;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/log_config_append' : ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $default_log_levels {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/default_log_levels' :
|
|
||||||
value => join(sort(join_keys_to_values($default_log_levels, '=')), ',');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/default_log_levels' : ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $publish_errors {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/publish_errors' : value => $publish_errors;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/publish_errors' : ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $fatal_deprecations {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/fatal_deprecations' : value => $fatal_deprecations;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/fatal_deprecations' : ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $instance_format {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/instance_format' : value => $instance_format;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/instance_format' : ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $instance_uuid_format {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/instance_uuid_format' : value => $instance_uuid_format;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/instance_uuid_format' : ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $log_date_format {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/log_date_format' : value => $log_date_format;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
heat_config {
|
|
||||||
'DEFAULT/log_date_format' : ensure => absent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,11 @@ describe 'heat::db::postgresql' do
|
|||||||
|
|
||||||
context 'on a RedHat osfamily' do
|
context 'on a RedHat osfamily' do
|
||||||
let :facts do
|
let :facts do
|
||||||
{
|
@default_facts.merge({
|
||||||
:osfamily => 'RedHat',
|
:osfamily => 'RedHat',
|
||||||
:operatingsystemrelease => '7.0',
|
:operatingsystemrelease => '7.0',
|
||||||
:concat_basedir => '/var/lib/puppet/concat'
|
:concat_basedir => '/var/lib/puppet/concat'
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with only required parameters' do
|
context 'with only required parameters' do
|
||||||
|
@ -8,10 +8,11 @@ describe 'heat::db' do
|
|||||||
|
|
||||||
it { is_expected.to contain_class('heat::db::sync') }
|
it { is_expected.to contain_class('heat::db::sync') }
|
||||||
it { is_expected.to contain_heat_config('database/connection').with_value('sqlite:////var/lib/heat/heat.sqlite').with_secret(true) }
|
it { is_expected.to contain_heat_config('database/connection').with_value('sqlite:////var/lib/heat/heat.sqlite').with_secret(true) }
|
||||||
it { is_expected.to contain_heat_config('database/idle_timeout').with_value('3600') }
|
it { is_expected.to contain_heat_config('database/idle_timeout').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_heat_config('database/min_pool_size').with_value('1') }
|
it { is_expected.to contain_heat_config('database/min_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_heat_config('database/max_retries').with_value('10') }
|
it { is_expected.to contain_heat_config('database/max_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_heat_config('database/retry_interval').with_value('10') }
|
it { is_expected.to contain_heat_config('database/max_retries').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_heat_config('database/retry_interval').with_value('<SERVICE DEFAULT>') }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -20,6 +21,7 @@ describe 'heat::db' do
|
|||||||
{ :database_connection => 'mysql://heat:heat@localhost/heat',
|
{ :database_connection => 'mysql://heat:heat@localhost/heat',
|
||||||
:database_idle_timeout => '3601',
|
:database_idle_timeout => '3601',
|
||||||
:database_min_pool_size => '2',
|
:database_min_pool_size => '2',
|
||||||
|
:database_max_pool_size => '12',
|
||||||
:database_max_retries => '11',
|
:database_max_retries => '11',
|
||||||
:database_retry_interval => '11',
|
:database_retry_interval => '11',
|
||||||
:sync_db => false }
|
:sync_db => false }
|
||||||
@ -29,6 +31,7 @@ describe 'heat::db' do
|
|||||||
it { is_expected.to contain_heat_config('database/connection').with_value('mysql://heat:heat@localhost/heat').with_secret(true) }
|
it { is_expected.to contain_heat_config('database/connection').with_value('mysql://heat:heat@localhost/heat').with_secret(true) }
|
||||||
it { is_expected.to contain_heat_config('database/idle_timeout').with_value('3601') }
|
it { is_expected.to contain_heat_config('database/idle_timeout').with_value('3601') }
|
||||||
it { is_expected.to contain_heat_config('database/min_pool_size').with_value('2') }
|
it { is_expected.to contain_heat_config('database/min_pool_size').with_value('2') }
|
||||||
|
it { is_expected.to contain_heat_config('database/max_pool_size').with_value('12') }
|
||||||
it { is_expected.to contain_heat_config('database/max_retries').with_value('11') }
|
it { is_expected.to contain_heat_config('database/max_retries').with_value('11') }
|
||||||
it { is_expected.to contain_heat_config('database/retry_interval').with_value('11') }
|
it { is_expected.to contain_heat_config('database/retry_interval').with_value('11') }
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@ describe 'heat' do
|
|||||||
:log_dir => '/var/log/heat',
|
:log_dir => '/var/log/heat',
|
||||||
:rabbit_host => '127.0.0.1',
|
:rabbit_host => '127.0.0.1',
|
||||||
:rabbit_port => 5672,
|
:rabbit_port => 5672,
|
||||||
:rabbit_userid => 'guest',
|
:rabbit_userid => '<SERVICE DEFAULT>',
|
||||||
:rabbit_password => '',
|
:rabbit_password => '',
|
||||||
:rabbit_virtual_host => '/',
|
:rabbit_virtual_host => '<SERVICE DEFAULT>',
|
||||||
:database_connection => 'mysql://user@host/database',
|
:database_connection => 'mysql://user@host/database',
|
||||||
:database_idle_timeout => 3600,
|
:database_idle_timeout => 3600,
|
||||||
:auth_uri => 'http://127.0.0.1:5000/v2.0',
|
:auth_uri => 'http://127.0.0.1:5000/v2.0',
|
||||||
@ -121,18 +121,18 @@ describe 'heat' do
|
|||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true )
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true )
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_rate').with_value('2')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_rate').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_value( params[:rabbit_host] ) }
|
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_value( params[:rabbit_host] ) }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_value( params[:rabbit_port] ) }
|
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_value( params[:rabbit_port] ) }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_hosts').with_value( "#{params[:rabbit_host]}:#{params[:rabbit_port]}" ) }
|
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_hosts').with_value( "#{params[:rabbit_host]}:#{params[:rabbit_port]}" ) }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') }
|
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') }
|
||||||
it { is_expected.to contain_heat_config('DEFAULT/rpc_response_timeout').with_value('60') }
|
it { is_expected.to contain_heat_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(false) }
|
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(false) }
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -143,12 +143,12 @@ describe 'heat' do
|
|||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_rate').with_value('2')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_rate').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
|
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_ensure('absent') }
|
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_ensure('absent') }
|
||||||
@ -164,12 +164,12 @@ describe 'heat' do
|
|||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true )
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true )
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_rate').with_value('2')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_rate').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
|
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_ensure('absent') }
|
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_ensure('absent') }
|
||||||
@ -195,10 +195,10 @@ describe 'heat' do
|
|||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true )
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true )
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60') }
|
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60') }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10') }
|
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10') }
|
||||||
@ -212,10 +212,10 @@ describe 'heat' do
|
|||||||
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_reconnect_interval_min').with_value('0') }
|
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_reconnect_interval_min').with_value('0') }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_reconnect_interval_max').with_value('0') }
|
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_reconnect_interval_max').with_value('0') }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_reconnect_interval').with_value('0') }
|
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_reconnect_interval').with_value('0') }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_heartbeat').with_value('60') }
|
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_heartbeat').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_protocol').with_value('tcp') }
|
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_protocol').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_tcp_nodelay').with_value(true) }
|
it { is_expected.to contain_heat_config('oslo_messaging_qpid/qpid_tcp_nodelay').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_heat_config('DEFAULT/rpc_response_timeout').with_value('60') }
|
it { is_expected.to contain_heat_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_heat_config('oslo_messaging_qpid/amqp_durable_queues').with_value(false) }
|
it { is_expected.to contain_heat_config('oslo_messaging_qpid/amqp_durable_queues').with_value(false) }
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -263,10 +263,10 @@ describe 'heat' do
|
|||||||
|
|
||||||
it do
|
it do
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -274,16 +274,15 @@ describe 'heat' do
|
|||||||
before do
|
before do
|
||||||
params.merge!(
|
params.merge!(
|
||||||
:rabbit_use_ssl => false,
|
:rabbit_use_ssl => false,
|
||||||
:kombu_ssl_version => 'TLSv1'
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
it do
|
it do
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
|
is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -296,20 +295,34 @@ describe 'heat' do
|
|||||||
|
|
||||||
context 'without required parameters' do
|
context 'without required parameters' do
|
||||||
|
|
||||||
context 'with rabbit_use_ssl => false and kombu_ssl_ca_certs parameter' do
|
context 'with rabbit_use_ssl => false and kombu_ssl_ca_certs parameter' do
|
||||||
before { params.merge!(:kombu_ssl_ca_certs => '/path/to/ssl/ca/certs') }
|
before { params.merge!(:kombu_ssl_ca_certs => '/path/to/ssl/ca/certs')}
|
||||||
it_raises 'a Puppet::Error', /The kombu_ssl_ca_certs parameter requires rabbit_use_ssl to be set to true/
|
it_raises 'a Puppet::Error', /The kombu_ssl_ca_certs parameter requires rabbit_use_ssl to be set to true/
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with rabbit_use_ssl => false and kombu_ssl_certfile parameter' do
|
context 'with rabbit_use_ssl => false and kombu_ssl_certfile parameter' do
|
||||||
before { params.merge!(:kombu_ssl_certfile => '/path/to/ssl/cert/file') }
|
before { params.merge!(:kombu_ssl_certfile => '/path/to/ssl/cert/file')}
|
||||||
it_raises 'a Puppet::Error', /The kombu_ssl_certfile parameter requires rabbit_use_ssl to be set to true/
|
it_raises 'a Puppet::Error', /The kombu_ssl_certfile parameter requires rabbit_use_ssl to be set to true/
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with rabbit_use_ssl => false and kombu_ssl_keyfile parameter' do
|
context 'with rabbit_use_ssl => false and kombu_ssl_keyfile parameter' do
|
||||||
before { params.merge!(:kombu_ssl_keyfile => '/path/to/ssl/keyfile') }
|
before { params.merge!(:kombu_ssl_keyfile => '/path/to/ssl/keyfile')}
|
||||||
it_raises 'a Puppet::Error', /The kombu_ssl_keyfile parameter requires rabbit_use_ssl to be set to true/
|
it_raises 'a Puppet::Error', /The kombu_ssl_keyfile parameter requires rabbit_use_ssl to be set to true/
|
||||||
end
|
end
|
||||||
|
context 'with kombu_ssl_certfile set to default and custom kombu_ssl_keyfile parameter' do
|
||||||
|
before { params.merge!(
|
||||||
|
:rabbit_use_ssl => true,
|
||||||
|
:kombu_ssl_keyfile => '/path/to/ssl/keyfile',
|
||||||
|
)}
|
||||||
|
it_raises 'a Puppet::Error', /The kombu_ssl_certfile and kombu_ssl_keyfile parameters must be used together/
|
||||||
|
end
|
||||||
|
context 'with kombu_ssl_keyfile set to default and custom kombu_ssl_certfile parameter' do
|
||||||
|
before { params.merge!(
|
||||||
|
:rabbit_use_ssl => true,
|
||||||
|
:kombu_ssl_certfile => '/path/to/ssl/cert/file',
|
||||||
|
)}
|
||||||
|
it_raises 'a Puppet::Error', /The kombu_ssl_certfile and kombu_ssl_keyfile parameters must be used together/
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -352,7 +365,7 @@ describe 'heat' do
|
|||||||
|
|
||||||
shared_examples_for 'without region_name set' do
|
shared_examples_for 'without region_name set' do
|
||||||
it 'doesnt have region_name set by default' do
|
it 'doesnt have region_name set by default' do
|
||||||
is_expected.to contain_heat_config('DEFAULT/region_name_for_services').with_enure('absent')
|
is_expected.to contain_heat_config('DEFAULT/region_name_for_services').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ describe 'heat::logging' do
|
|||||||
:logging_exception_prefix => '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s',
|
:logging_exception_prefix => '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s',
|
||||||
:log_config_append => '/etc/heat/logging.conf',
|
:log_config_append => '/etc/heat/logging.conf',
|
||||||
:publish_errors => true,
|
:publish_errors => true,
|
||||||
:default_log_levels => {
|
:default_log_levels => {
|
||||||
'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
|
'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
|
||||||
'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
|
'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
|
||||||
'iso8601' => 'WARN',
|
'iso8601' => 'WARN',
|
||||||
@ -57,11 +57,11 @@ describe 'heat::logging' do
|
|||||||
|
|
||||||
shared_examples 'basic default logging settings' do
|
shared_examples 'basic default logging settings' do
|
||||||
it 'configures heat logging settins with default values' do
|
it 'configures heat logging settins with default values' do
|
||||||
is_expected.to contain_heat_config('DEFAULT/use_syslog').with(:value => 'false')
|
is_expected.to contain_heat_config('DEFAULT/use_syslog').with(:value => '<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('DEFAULT/use_stderr').with(:value => 'true')
|
is_expected.to contain_heat_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('DEFAULT/log_dir').with(:value => '/var/log/heat')
|
is_expected.to contain_heat_config('DEFAULT/log_dir').with(:value => '/var/log/heat')
|
||||||
is_expected.to contain_heat_config('DEFAULT/verbose').with(:value => 'false')
|
is_expected.to contain_heat_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_heat_config('DEFAULT/debug').with(:value => 'false')
|
is_expected.to contain_heat_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ describe 'heat::logging' do
|
|||||||
:default_log_levels, :fatal_deprecations,
|
:default_log_levels, :fatal_deprecations,
|
||||||
:instance_format, :instance_uuid_format,
|
:instance_format, :instance_uuid_format,
|
||||||
:log_date_format, ].each { |param|
|
:log_date_format, ].each { |param|
|
||||||
it { is_expected.to contain_heat_config("DEFAULT/#{param}").with_ensure('absent') }
|
it { is_expected.to contain_heat_config("DEFAULT/#{param}").with_value('<SERVICE DEFAULT>') }
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user