mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
commit
b8866dfb0a
@ -500,6 +500,7 @@ def policy_exists(vhost, name, runas=None):
|
||||
policies = list_policies(runas=runas)
|
||||
return bool(vhost in policies and name in policies[vhost])
|
||||
|
||||
|
||||
def enable_plugin(name, runas=None):
|
||||
'''
|
||||
Enable a RabbitMQ plugin via the rabbitmq-plugin command.
|
||||
@ -510,6 +511,7 @@ def enable_plugin(name, runas=None):
|
||||
runas=runas)
|
||||
return _format_response(ret, 'Enabled')
|
||||
|
||||
|
||||
def disable_plugin(name, runas=None):
|
||||
'''
|
||||
Disable a RabbitMQ plugin via the rabbitmq-plugin command.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Manage RabbitMQ Clusters
|
||||
|
||||
@ -24,6 +25,7 @@ def __virtual__():
|
||||
name = False
|
||||
return name
|
||||
|
||||
|
||||
def join(name, host, user='rabbit', runas=None):
|
||||
'''
|
||||
Ensure the RabbitMQ plugin is enabled.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Manage RabbitMQ Plugins.
|
||||
|
||||
@ -23,6 +24,7 @@ def __virtual__():
|
||||
name = False
|
||||
return name
|
||||
|
||||
|
||||
def enabled(name, runas=None):
|
||||
'''
|
||||
Ensure the RabbitMQ plugin is enabled.
|
||||
@ -50,6 +52,7 @@ def enabled(name, runas=None):
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
def disabled(name, runas=None):
|
||||
'''
|
||||
Ensure the RabbitMQ plugin is enabled.
|
||||
|
@ -34,11 +34,11 @@ def __virtual__():
|
||||
|
||||
|
||||
def present(name,
|
||||
password=None,
|
||||
force=False,
|
||||
tags=None,
|
||||
perms={},
|
||||
runas=None):
|
||||
password=None,
|
||||
force=False,
|
||||
tags=None,
|
||||
perms=(),
|
||||
runas=None):
|
||||
'''
|
||||
Ensure the RabbitMQ user exists.
|
||||
|
||||
@ -81,9 +81,9 @@ def present(name,
|
||||
if tags:
|
||||
result = __salt__['rabbitmq.set_user_tags'](
|
||||
name, tags, runas=runas)
|
||||
for vhost, p in perms:
|
||||
for vhost, perm in perms:
|
||||
result = __salt__['rabbitmq.set_permissions'](
|
||||
vhost, name, p[0], p[1], p[2], runas)
|
||||
vhost, name, perm[0], perm[1], perm[2], runas)
|
||||
elif force:
|
||||
log.debug('User exists and force is set - Overriding')
|
||||
if password is not None:
|
||||
@ -97,9 +97,9 @@ def present(name,
|
||||
result.update(__salt__['rabbitmq.set_user_tags'](
|
||||
name, tags, runas=runas)
|
||||
)
|
||||
for vhost, p in perms:
|
||||
for vhost, perm in perms:
|
||||
result.update(__salt__['rabbitmq.set_permissions'](
|
||||
vhost, name, p[0], p[1], p[2], runas)
|
||||
vhost, name, perm[0], perm[1], perm[2], runas)
|
||||
)
|
||||
else:
|
||||
log.debug('User exists, and force is not set - Abandoning')
|
||||
|
Loading…
Reference in New Issue
Block a user