Puppet Class: rabbitmq

Inherited by:
rabbitmq::service
Defined in:
manifests/init.pp

Summary

A module to manage RabbitMQ

Overview

Examples:

Basic usage

include rabbitmq

rabbitmq class

class { 'rabbitmq':
  service_manage    => false,
  port              => '5672',
  delete_guest_user => true,
}

Offline installation from local mirror:

class { 'rabbitmq':
  key_content     => template('openstack/rabbit.pub.key'),
  package_gpg_key => '/tmp/rabbit.pub.key',
}

Use external package key source for any (apt/rpm) package provider:

class { 'rabbitmq':
  package_gpg_key => 'http://www.some_site.some_domain/some_key.pub.key',
}

To use RabbitMQ Environment Variables, use the parameters ‘environment_variables` e.g.:

class { 'rabbitmq':
  port                  => '5672',
  environment_variables => {
    'NODENAME'    => 'node01',
    'SERVICENAME' => 'RabbitMQ'
  }
}

Change RabbitMQ Config Variables in rabbitmq.config:

class { 'rabbitmq':
  port             => '5672',
  config_variables => {
    'hipe_compile' => true,
    'frame_max'    => 131072,
    'log_levels'   => "[{connection, info}]"
  }
}

Change Erlang Kernel Config Variables in rabbitmq.config

class { 'rabbitmq':
  port                    => '5672',
  config_kernel_variables => {
    'inet_dist_listen_min' => 9100,
    'inet_dist_listen_max' => 9105,
  }
}

Change Management Plugin Config Variables in rabbitmq.config

class { 'rabbitmq':
  config_management_variables => {
    'rates_mode' => 'basic',
  }
}

Change Additional Config Variables in rabbitmq.config

class { 'rabbitmq':
  config_additional_variables => {
    'autocluster' => '[{consul_service, "rabbit"},{cluster_name, "rabbit"}]',
    'foo'         => '[{bar, "baz"}]'
  }
}

This will result in the following config appended to the config file:
{autocluster, [{consul_service, "rabbit"},{cluster_name, "rabbit"}]},
 {foo, [{bar, "baz"}]}
(This is required for the [autocluster plugin](https://github.com/rabbitmq/rabbitmq-autocluster)

Use RabbitMQ clustering facilities

class { 'rabbitmq':
  config_cluster           => true,
  cluster_nodes            => ['rabbit1', 'rabbit2'],
  cluster_node_type        => 'ram',
  erlang_cookie            => 'A_SECRET_COOKIE_STRING',
  wipe_db_on_cookie_change => true,
}

Parameters:

  • admin_enable (Boolean) (defaults to: true)

    If enabled sets up the management interface/plugin for RabbitMQ. This also install the rabbitmqadmin command line tool.

  • management_enable (Boolean) (defaults to: false)

    If enabled sets up the management interface/plugin for RabbitMQ. NOTE: This does not install the rabbitmqadmin command line tool.

  • use_config_file_for_plugins (Boolean) (defaults to: false)

    If enabled the /etc/rabbitmq/enabled_plugins config file is created, replacing the use of the rabbitmqplugins provider to enable plugins.

  • auth_backends (Optional[Array]) (defaults to: undef)

    An array specifying authorization/authentication backend to use. Single quotes should be placed around array entries, ex. ‘[’baz‘, ’baz’]‘ Defaults to [rabbit_auth_backend_internal], and if using LDAP defaults to [rabbit_auth_backend_internal, rabbit_auth_backend_ldap].

  • cluster_node_type (Enum['ram', 'disc']) (defaults to: 'disc')

    Choose between disc and ram nodes.

  • cluster_nodes (Array) (defaults to: [])

    An array of nodes for clustering.

  • cluster_partition_handling (String) (defaults to: 'ignore')

    Value to set for ‘cluster_partition_handling` RabbitMQ configuration variable.

  • collect_statistics_interval (Optional[Integer]) (defaults to: undef)

    Set the collect_statistics_interval in rabbitmq.config

  • config (String) (defaults to: 'rabbitmq/rabbitmq.config.erb')

    The file to use as the rabbitmq.config template.

  • config_additional_variables (Hash) (defaults to: {})

    Additional config variables in rabbitmq.config

  • config_cluster (Boolean) (defaults to: false)

    Enable or disable clustering support.

  • config_kernel_variables (Hash) (defaults to: {})

    Hash of Erlang kernel configuration variables to set (see [Variables Configurable in rabbitmq.config](#variables-configurable-in-rabbitmq.config)).

  • config_path (Stdlib::Absolutepath) (defaults to: '/etc/rabbitmq/rabbitmq.config')

    The path to write the RabbitMQ configuration file to.

  • config_ranch (Boolean) (defaults to: true)

    When true, suppress config directives needed for older (<3.6) RabbitMQ versions.

  • config_management_variables (Hash) (defaults to: {})

    Hash of configuration variables for the [Management Plugin](www.rabbitmq.com/management.html).

  • config_stomp (Boolean) (defaults to: false)

    Enable or disable stomp.

  • config_shovel (Boolean) (defaults to: false)

    Enable or disable shovel.

  • config_shovel_statics (Hash) (defaults to: {})

    Hash of static shovel configurations

  • config_variables (Hash) (defaults to: {})

    To set config variables in rabbitmq.config

  • default_user (String) (defaults to: 'guest')

    Username to set for the ‘default_user` in rabbitmq.config.

  • default_pass (String) (defaults to: 'guest')

    Password to set for the ‘default_user` in rabbitmq.config.

  • delete_guest_user (Boolean) (defaults to: false)

    Controls whether default guest user is deleted.

  • env_config (String) (defaults to: 'rabbitmq/rabbitmq-env.conf.erb')

    The template file to use for rabbitmq_env.config.

  • env_config_path (Stdlib::Absolutepath) (defaults to: '/etc/rabbitmq/rabbitmq-env.conf')

    The path to write the rabbitmq_env.config file to.

  • environment_variables (Hash) (defaults to: { 'LC_ALL' => 'en_US.UTF-8' })

    RabbitMQ Environment Variables in rabbitmq_env.config

  • erlang_cookie (Optional[String]) (defaults to: undef)

    The erlang cookie to use for clustering - must be the same between all nodes. This value has no default and must be set explicitly if using clustering. If you run Pacemaker and you don’t want to use RabbitMQ buildin cluster, you can set config_cluster to ‘False’ and set ‘erlang_cookie’.

  • file_limit (Variant[Integer[-1],Enum['unlimited'],Pattern[/^(infinity|\d+(:(infinity|\d+))?)$/]]) (defaults to: 16384)

    Set rabbitmq file ulimit. Defaults to 16384. Only available on systems with ‘$::osfamily == ’Debian’‘ or `$::osfamily == ’RedHat’‘.

  • heartbeat (Optional[Integer]) (defaults to: undef)

    Set the heartbeat timeout interval, default is unset which uses the builtin server defaults of 60 seconds. Setting this

  • inetrc_config (String) (defaults to: 'rabbitmq/inetrc.erb')

    Template to use for the inetrc config

  • inetrc_config_path (Stdlib::Absolutepath) (defaults to: '/etc/rabbitmq/inetrc')

    Path of the file to push the inetrc config to.

  • ipv6 (Boolean) (defaults to: false)

    Whether to listen on ipv6

  • interface (Optional[String]) (defaults to: undef)

    Interface to bind to (sets tcp_listeners parameter). By default, bind to all interfaces to ‘0` will disable heartbeats.

  • key_content (Optional[String]) (defaults to: undef)

    Uses content method for Debian OS family. Should be a template for apt::source class. Overrides ‘package_gpg_key` behavior, if enabled. Undefined by default.

  • ldap_auth (Boolean) (defaults to: false)

    Set to true to enable LDAP auth.

  • ldap_server (Variant[String[1],Array[String[1]]]) (defaults to: 'ldap')

    LDAP server or servers to use for auth.

  • ldap_user_dn_pattern (Optional[String]) (defaults to: undef)

    User DN pattern for LDAP auth.

  • ldap_other_bind (String) (defaults to: 'anon')

    How to bind to the LDAP server. Defaults to ‘anon’.

  • ldap_config_variables (Hash) (defaults to: {})

    Hash of other LDAP config variables.

  • ldap_use_ssl (Boolean) (defaults to: false)

    Set to true to use SSL for the LDAP server.

  • ldap_port (Integer[1, 65535]) (defaults to: 389)

    Numeric port for LDAP server.

  • ldap_log (Boolean) (defaults to: false)

    Set to true to log LDAP auth.

  • manage_python (Boolean) (defaults to: true)

    If enabled, on platforms that don’t provide a Python 2 package by default, ensure that the python package is installed (for rabbitmqadmin). This will only apply if ‘admin_enable` and `service_manage` are set.

  • management_hostname (Optional[String]) (defaults to: undef)

    The hostname for the RabbitMQ management interface.

  • management_port (Integer[1, 65535]) (defaults to: 15672)

    The port for the RabbitMQ management interface.

  • management_ip_address (Optional[String]) (defaults to: undef)

    Allows you to set the IP for management interface to bind to separately. Set to 127.0.0.1 to bind to localhost only, or 0.0.0.0 to bind to all interfaces.

  • management_ssl (Boolean) (defaults to: true)

    Enable/Disable SSL for the management port. Has an effect only if ssl => true.

  • node_ip_address (Optional[String]) (defaults to: undef)

    Allows you to set the IP for RabbitMQ service to bind to. Set to 127.0.0.1 to bind to localhost only, or 0.0.0.0 to bind to all interfaces.

  • package_apt_pin (Optional[Variant[Numeric, String]]) (defaults to: undef)

    Whether to pin the package to a particular source

  • package_ensure (String) (defaults to: 'installed')

    Determines the ensure state of the package. Set to installed by default, but could be changed to latest.

  • package_gpg_key (Optional[String]) (defaults to: undef)

    RPM package GPG key to import. Uses source method. Should be a URL for Debian/RedHat OS family, or a file name for RedHat OS family. Set to www.rabbitmq.com/rabbitmq-release-signing-key.asc for RedHat OS Family and packagecloud.io/rabbitmq/rabbitmq-server/gpgkey for Debian OS Family by default. Note, that ‘key_content`, if specified, would override this parameter for Debian OS family.

  • package_name (Variant[String, Array]) (defaults to: 'rabbitmq')

    Name(s) of the package(s) to install

  • port (Integer) (defaults to: 5672)

    The RabbitMQ port.

  • python_package (String) (defaults to: 'python')

    Name of the package required by rabbitmqadmin.

  • repos_ensure (Boolean) (defaults to: false)

    Ensure that a repo with the official (and newer) RabbitMQ package is configured, along with its signing key. Defaults to false (use system packages). This does not ensure that soft dependencies (like EPEL on RHEL systems) are present. It also does not solve the erlang dependency. See www.rabbitmq.com/which-erlang.html for a good breakdown of the different ways of handling the erlang deps. See also github.com/voxpupuli/puppet-rabbitmq/issues/788

  • service_ensure (Enum['running', 'stopped']) (defaults to: 'running')

    The state of the service.

  • service_manage (Boolean) (defaults to: true)

    Determines if the service is managed.

  • service_name (String) (defaults to: 'rabbitmq')

    The name of the service to manage.

  • service_restart (Boolean) (defaults to: true)

    Default defined in param.pp. Whether to restart the service on config change.

  • ssl (Boolean) (defaults to: false)

    Configures the service for using SSL.

  • ssl_cacert (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    CA cert path to use for SSL.

  • ssl_cert (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Cert to use for SSL.

  • ssl_cert_password (Optional[String]) (defaults to: undef)

    Password used when generating CSR.

  • ssl_depth (Optional[Integer]) (defaults to: undef)

    SSL verification depth.

  • ssl_dhfile (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Use this dhparam file [example: generate with ‘openssl dhparam -out /etc/rabbitmq/ssl/dhparam.pem 2048`

  • ssl_erl_dist (Boolean) (defaults to: false)

    Whether to use the erlang package’s SSL (relies on the ssl_erl_path fact)

  • ssl_honor_cipher_order (Boolean) (defaults to: true)

    Force use of server cipher order

  • ssl_interface (Optional[String]) (defaults to: undef)

    Interface for SSL listener to bind to

  • ssl_key (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Key to use for SSL.

  • ssl_only (Boolean) (defaults to: false)

    Configures the service to only use SSL. No cleartext TCP listeners will be created. Requires that ssl => true and port => undef

  • ssl_management_port (Integer[1, 65535]) (defaults to: 15671)

    SSL management port.

  • ssl_management_cacert (Optional[Stdlib::Absolutepath]) (defaults to: $ssl_cacert)

    SSL management cacert. If unset set to ssl_cacert for backwards compatibility.

  • ssl_management_cert (Optional[Stdlib::Absolutepath]) (defaults to: $ssl_cert)

    SSL management cert. If unset set to ssl_cert for backwards compatibility.

  • ssl_management_key (Optional[Stdlib::Absolutepath]) (defaults to: $ssl_key)

    SSL management key. If unset set to ssl_key for backwards compatibility.

  • ssl_port (Integer[1, 65535]) (defaults to: 5671)

    SSL port for RabbitMQ

  • ssl_reuse_sessions (Boolean) (defaults to: true)

    Reuse ssl sessions

  • ssl_secure_renegotiate (Boolean) (defaults to: true)

    Use ssl secure renegotiate

  • ssl_stomp_port (Integer[1, 65535]) (defaults to: 6164)

    SSL stomp port.

  • ssl_verify (Enum['verify_none','verify_peer']) (defaults to: 'verify_none')

    rabbitmq.config SSL verify setting.

  • ssl_fail_if_no_peer_cert (Boolean) (defaults to: false)

    rabbitmq.config ‘fail_if_no_peer_cert` setting.

  • ssl_management_verify (Enum['verify_none','verify_peer']) (defaults to: 'verify_none')

    rabbitmq.config SSL verify setting for rabbitmq_management.

  • ssl_versions (Optional[Array]) (defaults to: undef)

    Choose which SSL versions to enable. Example: ‘[’tlsv1.2’, ‘tlsv1.1’]‘ Note that it is recommended to disable `sslv3 and `tlsv1` to prevent against POODLE and BEAST attacks. Please see the [RabbitMQ SSL](www.rabbitmq.com/ssl.html) documentation for more information.

  • ssl_ciphers (Array) (defaults to: [])

    Support only a given list of SSL ciphers, using either the Erlang or OpenSSL styles. Supported ciphers in your install can be listed with: ‘rabbitmqctl eval ’ssl:cipher_suites().‘` Functionality can be tested with cipherscan or similar tool: github.com/mozilla/cipherscan

    • Erlang style: ‘[’ecdhe_rsa,aes_256_cbc,sha’, ‘dhe_rsa,aes_256_cbc,sha’]‘

    • OpenSSL style: ‘[’ECDHE-RSA-AES256-SHA’, ‘DHE-RSA-AES256-SHA’]‘

  • stomp_port (Integer[1, 65535]) (defaults to: 6163)

    The port to use for Stomp.

  • stomp_ssl_only (Boolean) (defaults to: false)

    Configures STOMP to only use SSL. No cleartext STOMP TCP listeners will be created. Requires setting ssl_stomp_port also.

  • stomp_ensure (Boolean) (defaults to: false)

    Enable to install the stomp plugin.

  • tcp_backlog (Integer) (defaults to: 128)

    The size of the backlog on TCP connections.

  • tcp_keepalive (Boolean) (defaults to: false)

    Enable TCP connection keepalive for RabbitMQ service.

  • tcp_recbuf (Optional[Integer]) (defaults to: undef)

    Corresponds to recbuf in RabbitMQ ‘tcp_listen_options`

  • tcp_sndbuf (Optional[Integer]) (defaults to: undef)

    Integer, corresponds to sndbuf in RabbitMQ ‘tcp_listen_options`

  • wipe_db_on_cookie_change (Boolean) (defaults to: false)

    Boolean to determine if we should DESTROY AND DELETE the RabbitMQ database.

  • rabbitmq_user (String) (defaults to: 'rabbitmq')

    OS dependent The system user the rabbitmq daemon runs as.

  • rabbitmq_group (String) (defaults to: 'rabbitmq')

    OS dependent The system group the rabbitmq daemon runs as.

  • rabbitmq_home (Stdlib::Absolutepath) (defaults to: '/var/lib/rabbitmq')

    OS dependent The home directory of the rabbitmq deamon.

  • rabbitmqadmin_package (Optional[String]) (defaults to: undef)

    OS dependent If undef: install rabbitmqadmin via archive, otherwise via package

  • archive_options (Array) (defaults to: [])

    Extra options to Archive resource to download rabbitmqadmin file

  • loopback_users (Array) (defaults to: ['guest'])

    This option configures a list of users to allow access via the loopback interfaces

  • package_source (Optional[String]) (defaults to: undef)
  • package_provider (Optional[String]) (defaults to: undef)
  • ssl_management_fail_if_no_peer_cert (Boolean) (defaults to: false)


301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
# File 'manifests/init.pp', line 301

class rabbitmq (
  Boolean $admin_enable                                                                            = true,
  Boolean $management_enable                                                                       = false,
  Boolean $use_config_file_for_plugins                                                             = false,
  Enum['ram', 'disc'] $cluster_node_type                                                           = 'disc',
  Array $cluster_nodes                                                                             = [],
  String $config                                                                                   = 'rabbitmq/rabbitmq.config.erb',
  Boolean $config_cluster                                                                          = false,
  Stdlib::Absolutepath $config_path                                                                = '/etc/rabbitmq/rabbitmq.config',
  Boolean $config_ranch                                                                            = true,
  Boolean $config_stomp                                                                            = false,
  Boolean $config_shovel                                                                           = false,
  Hash $config_shovel_statics                                                                      = {},
  String $default_user                                                                             = 'guest',
  String $default_pass                                                                             = 'guest',
  Boolean $delete_guest_user                                                                       = false,
  String $env_config                                                                               = 'rabbitmq/rabbitmq-env.conf.erb',
  Stdlib::Absolutepath $env_config_path                                                            = '/etc/rabbitmq/rabbitmq-env.conf',
  Optional[String] $erlang_cookie                                                                  = undef,
  Optional[String] $interface                                                                      = undef,
  Optional[String] $management_ip_address                                                          = undef,
  Integer[1, 65535] $management_port                                                               = 15672,
  Boolean $management_ssl                                                                          = true,
  Optional[String] $management_hostname                                                            = undef,
  Optional[String] $node_ip_address                                                                = undef,
  Optional[Variant[Numeric, String]] $package_apt_pin                                              = undef,
  String $package_ensure                                                                           = 'installed',
  Optional[String] $package_gpg_key                                                                = undef,
  Variant[String, Array] $package_name                                                             = 'rabbitmq',
  Optional[String] $package_source                                                                 = undef,
  Optional[String] $package_provider                                                               = undef,
  Boolean $repos_ensure                                                                            = false,
  Boolean $manage_python                                                                           = true,
  String $python_package                                                                           = 'python',
  String $rabbitmq_user                                                                            = 'rabbitmq',
  String $rabbitmq_group                                                                           = 'rabbitmq',
  Stdlib::Absolutepath $rabbitmq_home                                                              = '/var/lib/rabbitmq',
  Integer $port                                                                                    = 5672,
  Boolean $tcp_keepalive                                                                           = false,
  Integer $tcp_backlog                                                                             = 128,
  Optional[Integer] $tcp_sndbuf                                                                    = undef,
  Optional[Integer] $tcp_recbuf                                                                    = undef,
  Optional[Integer] $heartbeat                                                                     = undef,
  Enum['running', 'stopped'] $service_ensure                                                       = 'running',
  Boolean $service_manage                                                                          = true,
  String $service_name                                                                             = 'rabbitmq',
  Boolean $ssl                                                                                     = false,
  Boolean $ssl_only                                                                                = false,
  Optional[Stdlib::Absolutepath] $ssl_cacert                                                       = undef,
  Optional[Stdlib::Absolutepath] $ssl_cert                                                         = undef,
  Optional[Stdlib::Absolutepath] $ssl_key                                                          = undef,
  Optional[Integer] $ssl_depth                                                                     = undef,
  Optional[String] $ssl_cert_password                                                              = undef,
  Integer[1, 65535] $ssl_port                                                                      = 5671,
  Optional[String] $ssl_interface                                                                  = undef,
  Integer[1, 65535] $ssl_management_port                                                           = 15671,
  Optional[Stdlib::Absolutepath] $ssl_management_cacert                                            = $ssl_cacert,
  Optional[Stdlib::Absolutepath] $ssl_management_cert                                              = $ssl_cert,
  Optional[Stdlib::Absolutepath] $ssl_management_key                                               = $ssl_key,
  Integer[1, 65535] $ssl_stomp_port                                                                = 6164,
  Enum['verify_none','verify_peer'] $ssl_verify                                                    = 'verify_none',
  Boolean $ssl_fail_if_no_peer_cert                                                                = false,
  Enum['verify_none','verify_peer'] $ssl_management_verify                                         = 'verify_none',
  Boolean $ssl_management_fail_if_no_peer_cert                                                     = false,
  Optional[Array] $ssl_versions                                                                    = undef,
  Boolean $ssl_secure_renegotiate                                                                  = true,
  Boolean $ssl_reuse_sessions                                                                      = true,
  Boolean $ssl_honor_cipher_order                                                                  = true,
  Optional[Stdlib::Absolutepath] $ssl_dhfile                                                       = undef,
  Array $ssl_ciphers                                                                               = [],
  Boolean $stomp_ensure                                                                            = false,
  Boolean $ldap_auth                                                                               = false,
  Variant[String[1],Array[String[1]]] $ldap_server                                                 = 'ldap',
  Optional[String] $ldap_user_dn_pattern                                                           = undef,
  String $ldap_other_bind                                                                          = 'anon',
  Boolean $ldap_use_ssl                                                                            = false,
  Integer[1, 65535] $ldap_port                                                                     = 389,
  Boolean $ldap_log                                                                                = false,
  Hash $ldap_config_variables                                                                      = {},
  Integer[1, 65535] $stomp_port                                                                    = 6163,
  Boolean $stomp_ssl_only                                                                          = false,
  Boolean $wipe_db_on_cookie_change                                                                = false,
  String $cluster_partition_handling                                                               = 'ignore',
  Variant[Integer[-1],Enum['unlimited'],Pattern[/^(infinity|\d+(:(infinity|\d+))?)$/]] $file_limit = 16384,
  Hash $environment_variables                                                                      = { 'LC_ALL' => 'en_US.UTF-8' },
  Hash $config_variables                                                                           = {},
  Hash $config_kernel_variables                                                                    = {},
  Hash $config_management_variables                                                                = {},
  Hash $config_additional_variables                                                                = {},
  Optional[Array] $auth_backends                                                                   = undef,
  Optional[String] $key_content                                                                    = undef,
  Optional[Integer] $collect_statistics_interval                                                   = undef,
  Boolean $ipv6                                                                                    = false,
  String $inetrc_config                                                                            = 'rabbitmq/inetrc.erb',
  Stdlib::Absolutepath $inetrc_config_path                                                         = '/etc/rabbitmq/inetrc',
  Boolean $ssl_erl_dist                                                                            = false,
  Optional[String] $rabbitmqadmin_package                                                          = undef,
  Array $archive_options                                                                           = [],
  Array $loopback_users                                                                            = ['guest'],
  Boolean $service_restart                                                                         = true,
) {
  if $ssl_only and ! $ssl {
    fail('$ssl_only => true requires that $ssl => true')
  }

  if $config_stomp and $stomp_ssl_only and ! $ssl_stomp_port {
    fail('$stomp_ssl_only requires that $ssl_stomp_port be set')
  }

  if $ssl_versions {
    unless $ssl {
      fail('$ssl_versions requires that $ssl => true')
    }
  }

  if $repos_ensure {
    case $facts['os']['family'] {
      'RedHat': {
        contain rabbitmq::repo::rhel
        Class['rabbitmq::repo::rhel'] -> Class['rabbitmq::install']
      }
      'Debian': {
        contain rabbitmq::repo::apt
        Class['rabbitmq::repo::apt'] -> Class['rabbitmq::install']
      }
      default: {
      }
    }
  }

  contain rabbitmq::install
  contain rabbitmq::config
  contain rabbitmq::service
  contain rabbitmq::management

  unless $use_config_file_for_plugins {
    # NOTE(hjensas): condition on $service_manage to keep current behaviour.
    # The condition is likely not required because installiton of rabbitmqadmin
    # is no longer handled here.
    # TODO: Remove the condition on $service_manage
    if ($management_enable or $admin_enable) and $service_manage {
      rabbitmq_plugin { 'rabbitmq_management':
        ensure   => present,
        notify   => Class['rabbitmq::service'],
        provider => 'rabbitmqplugins',
      }
    }

    if ($stomp_ensure) {
      rabbitmq_plugin { 'rabbitmq_stomp':
        ensure   => present,
        notify   => Class['rabbitmq::service'],
        provider => 'rabbitmqplugins',
      }
    }

    if ($ldap_auth) {
      rabbitmq_plugin { 'rabbitmq_auth_backend_ldap':
        ensure   => present,
        notify   => Class['rabbitmq::service'],
        provider => 'rabbitmqplugins',
      }
    }

    if ($config_shovel) {
      rabbitmq_plugin { 'rabbitmq_shovel':
        ensure   => present,
        notify   => Class['rabbitmq::service'],
        provider => 'rabbitmqplugins',
      }

      if ($management_enable or $admin_enable) {
        rabbitmq_plugin { 'rabbitmq_shovel_management':
          ensure   => present,
          notify   => Class['rabbitmq::service'],
          provider => 'rabbitmqplugins',
        }
      }
    }
  }

  if $admin_enable and $service_manage {
    include 'rabbitmq::install::rabbitmqadmin'

    Class['rabbitmq::service'] -> Class['rabbitmq::install::rabbitmqadmin']
    Class['rabbitmq::install::rabbitmqadmin'] -> Rabbitmq_exchange<| |>
  }

  if ($service_restart) {
    Class['rabbitmq::config'] ~> Class['rabbitmq::service']
  }

  Class['rabbitmq::install']
  -> Class['rabbitmq::config']
  -> Class['rabbitmq::service']
  -> Class['rabbitmq::management']

  # Make sure the various providers have their requirements in place.
  Class['rabbitmq::install'] -> Rabbitmq_plugin<| |>
}