Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8396027
rabbitmqplugins.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
rabbitmqplugins.rb
View Options
Puppet
::
Type
.
type
(
:rabbitmq_plugin
)
.
provide
(
:rabbitmqplugins
)
do
if
Puppet
::
PUPPETVERSION
.
to_f
<
3
commands
:rabbitmqplugins
=>
'rabbitmq-plugins'
else
if
Facter
.
value
(
:osfamily
)
==
'RedHat'
has_command
(
:rabbitmqplugins
,
'/usr/lib/rabbitmq/bin/rabbitmq-plugins'
)
do
environment
:HOME
=>
"/tmp"
end
else
has_command
(
:rabbitmqplugins
,
'rabbitmq-plugins'
)
do
environment
:HOME
=>
"/tmp"
end
end
end
defaultfor
:feature
=>
:posix
def
self
.
instances
rabbitmqplugins
(
'list'
,
'-E'
)
.
split
(
/\n/
)
.
map
do
|
line
|
if
line
.
split
(
/\s+/
)
[
1
]
=~
/^(\S+)$/
new
(
:name
=>
$1
)
else
raise
Puppet
::
Error
,
"Cannot parse invalid plugins line:
#{
line
}
"
end
end
end
def
create
rabbitmqplugins
(
'enable'
,
resource
[
:name
]
)
end
def
destroy
rabbitmqplugins
(
'disable'
,
resource
[
:name
]
)
end
def
exists?
rabbitmqplugins
(
'list'
,
'-E'
)
.
split
(
/\n/
)
.
detect
do
|
line
|
line
.
split
(
/\s+/
)
[
1
].
match
(
/^
#{
resource
[
:name
]
}
$/
)
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Jun 4 2025, 7:48 PM (12 w, 2 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3399385
Attached To
R198 puppet-puppet-rabbitmq
Event Timeline
Log In to Comment