如何通过 puppet 配置 rabbitmq 队列
How do I configure rabbitmq queue via puppet
我正在尝试通过 puppet 安装 rabbitmq。我正在使用 puppetlabs-rabbitmq 模块。它还具有配置队列和交换器的部分,它们是 Native Types
。我不知道如何使用这些本机类型。
我的rabbitmq安装代码:
class rabbitmq-concrete{
$tools = ["vim-enhanced","mc"]
package { $tools: ensure => "installed" }
$interface = "enp0s8"
$address = inline_template("<%= scope.lookupvar('::ipaddress_${interface}') -%>")
class { 'rabbitmq':
config_cluster => true,
cluster_nodes => ['rml01', 'rml02'],
cluster_node_type => 'disc',
manage_repos => true,
node_ip_address => $address,
erlang_cookie => 'rmq_secret',
}
rabbitmq_exchange { "logging@${node_name}":
type => 'topic',
ensure => present,
}
rabbitmq_queue { "logging@${node_name}":
durable => true,
auto_delete => false,
arguments => {
x-message-ttl => 123,
x-dead-letter-exchange => 'other'
},
ensure => present,
}
rabbitmq_binding { "logging@logging@${node_name}":
destination_type => 'logging',
routing_key => '#',
arguments => {},
ensure => present,
}
}
include rabbitmq-concrete
我收到以下错误:
==> rml01: Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type rabbitmq_queue at /tmp/vagrant-puppet-2/manifests/site.pp:35 on node rml01
==> rml01: Wrapped exception:
==> rml01: Invalid resource type rabbitmq_queue
==> rml01: Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type rabbitmq_queue at /tmp/vagrant-puppet-2/manifests/site.pp:35 on node rml01
注意:当我省略这些原生类型时,rabbit 安装效果很好。
如何使用 Native Types
配置 rabbitmq_queue
、rabbitmq_exchange
和 rabbitmq_binding
?
您是否具备所需的先决条件?您需要 Forge 中的以下软件包:
puppetlabs/stdlib
stahnma/epel
nanliu/staging
garethr/erlang
我在您的清单中添加了:
include epel
include staging
class { 'erlang': epel_enable => true}
您的问题日期为 2 月 13 日,但在 Puppet Forge 上查看这些功能仅在 3 月 10 日的最新版本 5.1.0 中添加到该模块。
完整更新日志 => https://forge.puppetlabs.com/puppetlabs/rabbitmq/changelog
删节:
“2015-03-10 - 版本 5.1.0
总结
此版本添加了几个功能,以提高 rabbitmq 配置的灵活性,包括一些错误修复,并将 puppetlabs-stdlib 的最低要求版本提高到 3.0.0。
特点
添加 rabbitmq_queue 和 rabbitmq_binding 类型"
我正在尝试通过 puppet 安装 rabbitmq。我正在使用 puppetlabs-rabbitmq 模块。它还具有配置队列和交换器的部分,它们是 Native Types
。我不知道如何使用这些本机类型。
我的rabbitmq安装代码:
class rabbitmq-concrete{
$tools = ["vim-enhanced","mc"]
package { $tools: ensure => "installed" }
$interface = "enp0s8"
$address = inline_template("<%= scope.lookupvar('::ipaddress_${interface}') -%>")
class { 'rabbitmq':
config_cluster => true,
cluster_nodes => ['rml01', 'rml02'],
cluster_node_type => 'disc',
manage_repos => true,
node_ip_address => $address,
erlang_cookie => 'rmq_secret',
}
rabbitmq_exchange { "logging@${node_name}":
type => 'topic',
ensure => present,
}
rabbitmq_queue { "logging@${node_name}":
durable => true,
auto_delete => false,
arguments => {
x-message-ttl => 123,
x-dead-letter-exchange => 'other'
},
ensure => present,
}
rabbitmq_binding { "logging@logging@${node_name}":
destination_type => 'logging',
routing_key => '#',
arguments => {},
ensure => present,
}
}
include rabbitmq-concrete
我收到以下错误:
==> rml01: Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type rabbitmq_queue at /tmp/vagrant-puppet-2/manifests/site.pp:35 on node rml01
==> rml01: Wrapped exception:
==> rml01: Invalid resource type rabbitmq_queue
==> rml01: Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type rabbitmq_queue at /tmp/vagrant-puppet-2/manifests/site.pp:35 on node rml01
注意:当我省略这些原生类型时,rabbit 安装效果很好。
如何使用 Native Types
配置 rabbitmq_queue
、rabbitmq_exchange
和 rabbitmq_binding
?
您是否具备所需的先决条件?您需要 Forge 中的以下软件包:
puppetlabs/stdlib
stahnma/epel
nanliu/staging
garethr/erlang
我在您的清单中添加了:
include epel
include staging
class { 'erlang': epel_enable => true}
您的问题日期为 2 月 13 日,但在 Puppet Forge 上查看这些功能仅在 3 月 10 日的最新版本 5.1.0 中添加到该模块。
完整更新日志 => https://forge.puppetlabs.com/puppetlabs/rabbitmq/changelog
删节: “2015-03-10 - 版本 5.1.0
总结 此版本添加了几个功能,以提高 rabbitmq 配置的灵活性,包括一些错误修复,并将 puppetlabs-stdlib 的最低要求版本提高到 3.0.0。
特点
添加 rabbitmq_queue 和 rabbitmq_binding 类型"