diff --git a/salt/modules/rabbitmq.py b/salt/modules/rabbitmq.py index 6afc2b1eab..7f441b4e2f 100644 --- a/salt/modules/rabbitmq.py +++ b/salt/modules/rabbitmq.py @@ -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. diff --git a/salt/states/rabbitmq_cluster.py b/salt/states/rabbitmq_cluster.py index 114ec8aad8..e92965b43f 100644 --- a/salt/states/rabbitmq_cluster.py +++ b/salt/states/rabbitmq_cluster.py @@ -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. diff --git a/salt/states/rabbitmq_plugin.py b/salt/states/rabbitmq_plugin.py index d89d457abb..b4b1f0fc30 100644 --- a/salt/states/rabbitmq_plugin.py +++ b/salt/states/rabbitmq_plugin.py @@ -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. diff --git a/salt/states/rabbitmq_user.py b/salt/states/rabbitmq_user.py index ad744a3aa6..c42594d818 100644 --- a/salt/states/rabbitmq_user.py +++ b/salt/states/rabbitmq_user.py @@ -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')