aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/profile/base/rabbitmq.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/profile/base/rabbitmq.pp')
-rw-r--r--manifests/profile/base/rabbitmq.pp54
1 files changed, 47 insertions, 7 deletions
diff --git a/manifests/profile/base/rabbitmq.pp b/manifests/profile/base/rabbitmq.pp
index 15bab44..1eaabf0 100644
--- a/manifests/profile/base/rabbitmq.pp
+++ b/manifests/profile/base/rabbitmq.pp
@@ -34,22 +34,43 @@
# (Optional) RabbitMQ environment.
# Defaults to hiera('rabbitmq_environment').
#
+# [*inet_dist_interface*]
+# (Optional) Address to bind the inter-cluster interface
+# to. It is the inet_dist_use_interface option in the kernel variables
+# Defaults to hiera('rabbitmq::interface', undef).
+#
# [*nodes*]
# (Optional) Array of host(s) for RabbitMQ nodes.
# Defaults to hiera('rabbitmq_node_names', []).
#
+# [*rabbitmq_pass*]
+# (Optional) RabbitMQ Default Password.
+# Defaults to hiera('rabbitmq::default_pass')
+#
+# [*rabbitmq_user*]
+# (Optional) RabbitMQ Default User.
+# Defaults to hiera('rabbitmq::default_user')
+#
+# [*stack_action*]
+# (Optional) Action of the stack deployment.
+# Defaults to hiera('stack_action')
+#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
class tripleo::profile::base::rabbitmq (
- $config_variables = hiera('rabbitmq_config_variables'),
- $environment = hiera('rabbitmq_environment'),
- $ipv6 = str2bool(hiera('rabbit_ipv6', false)),
- $kernel_variables = hiera('rabbitmq_kernel_variables'),
- $nodes = hiera('rabbitmq_node_names', []),
- $step = hiera('step'),
+ $config_variables = hiera('rabbitmq_config_variables'),
+ $environment = hiera('rabbitmq_environment'),
+ $ipv6 = str2bool(hiera('rabbit_ipv6', false)),
+ $kernel_variables = hiera('rabbitmq_kernel_variables'),
+ $inet_dist_interface = hiera('rabbitmq::interface', undef),
+ $nodes = hiera('rabbitmq_node_names', []),
+ $rabbitmq_pass = hiera('rabbitmq::default_pass'),
+ $rabbitmq_user = hiera('rabbitmq::default_user'),
+ $stack_action = hiera('stack_action'),
+ $step = hiera('step'),
) {
# IPv6 environment, necessary for RabbitMQ.
if $ipv6 {
@@ -60,6 +81,14 @@ class tripleo::profile::base::rabbitmq (
} else {
$rabbit_env = $environment
}
+ if $inet_dist_interface {
+ $real_kernel_variables = merge(
+ $kernel_variables,
+ { 'inet_dist_use_interface' => ip_to_erl_format($inet_dist_interface) },
+ )
+ } else {
+ $real_kernel_variables = $kernel_variables
+ }
$manage_service = hiera('rabbitmq::service_manage', true)
if $step >= 1 {
@@ -68,7 +97,7 @@ class tripleo::profile::base::rabbitmq (
class { '::rabbitmq':
config_cluster => $manage_service,
cluster_nodes => $nodes,
- config_kernel_variables => $kernel_variables,
+ config_kernel_variables => $real_kernel_variables,
config_variables => $config_variables,
environment_variables => $rabbit_env,
}
@@ -89,6 +118,17 @@ class tripleo::profile::base::rabbitmq (
environment_variables => $rabbit_env,
}
}
+ # In case of HA, starting of rabbitmq-server is managed by pacemaker, because of which, a dependency
+ # to Service['rabbitmq-server'] will not work. Sticking with UPDATE action.
+ if $stack_action == 'UPDATE' {
+ # Required for changing password on update scenario. Password will be changed only when
+ # called explicity, if the rabbitmq service is already running.
+ rabbitmq_user { $rabbitmq_user :
+ password => $rabbitmq_pass,
+ provider => 'rabbitmqctl',
+ admin => true,
+ }
+ }
}
}