salt.modules.rabbitmq

Module to provide RabbitMQ compatibility to Salt. Todo: A lot, need to add cluster support, logging, and minion configuration data.

salt.modules.rabbitmq.add_user(name, password=None, runas=None)

Add a rabbitMQ user via rabbitmqctl user_add <user> <password>

CLI Example:

salt '*' rabbitmq.add_user rabbit_user password
salt.modules.rabbitmq.add_vhost(vhost, runas=None)

Adds a vhost via rabbitmqctl add_vhost.

CLI Example:

salt '*' rabbitmq add_vhost '<vhost_name>'
salt.modules.rabbitmq.change_password(name, password, runas=None)

Changes a user's password.

CLI Example:

salt '*' rabbitmq.change_password rabbit_user password
salt.modules.rabbitmq.check_password(name, password, runas=None)

New in version 2016.3.0.

Checks if a user's password is valid.

CLI Example:

salt '*' rabbitmq.check_password rabbit_user password
salt.modules.rabbitmq.clear_password(name, runas=None)

Removes a user's password.

CLI Example:

salt '*' rabbitmq.clear_password rabbit_user
salt.modules.rabbitmq.cluster_status(runas=None)

return rabbitmq cluster_status

CLI Example:

salt '*' rabbitmq.cluster_status
salt.modules.rabbitmq.delete_policy(vhost, name, runas=None)

Delete a policy based on rabbitmqctl clear_policy.

Reference: http://www.rabbitmq.com/ha.html

CLI Example:

salt '*' rabbitmq.delete_policy / HA'
salt.modules.rabbitmq.delete_user(name, runas=None)

Deletes a user via rabbitmqctl delete_user.

CLI Example:

salt '*' rabbitmq.delete_user rabbit_user
salt.modules.rabbitmq.delete_vhost(vhost, runas=None)

Deletes a vhost rabbitmqctl delete_vhost.

CLI Example:

salt '*' rabbitmq.delete_vhost '<vhost_name>'
salt.modules.rabbitmq.disable_plugin(name, runas=None)

Disable a RabbitMQ plugin via the rabbitmq-plugins command.

CLI Example:

salt '*' rabbitmq.disable_plugin foo
salt.modules.rabbitmq.enable_plugin(name, runas=None)

Enable a RabbitMQ plugin via the rabbitmq-plugins command.

CLI Example:

salt '*' rabbitmq.enable_plugin foo
salt.modules.rabbitmq.force_reset(runas=None)

Forcefully Return a RabbitMQ node to its virgin state

CLI Example:

salt '*' rabbitmq.force_reset
salt.modules.rabbitmq.join_cluster(host, user='rabbit', ram_node=None, runas=None)

Join a rabbit cluster

CLI Example:

salt '*' rabbitmq.join_cluster 'rabbit.example.com' 'rabbit'
salt.modules.rabbitmq.list_available_plugins(runas=None)

Returns a list of the names of all available plugins (enabled and disabled).

CLI Example:

salt '*' rabbitmq.list_available_plugins
salt.modules.rabbitmq.list_enabled_plugins(runas=None)

Returns a list of the names of the enabled plugins.

CLI Example:

salt '*' rabbitmq.list_enabled_plugins
salt.modules.rabbitmq.list_permissions(vhost, runas=None)

Lists permissions for vhost via rabbitmqctl list_permissions

CLI Example:

salt '*' rabbitmq.list_permissions '/myvhost'
salt.modules.rabbitmq.list_policies(vhost='/', runas=None)

Return a dictionary of policies nested by vhost and name based on the data returned from rabbitmqctl list_policies.

Reference: http://www.rabbitmq.com/ha.html

CLI Example:

salt '*' rabbitmq.list_policies'
salt.modules.rabbitmq.list_queues(runas=None, *args)

Returns queue details of the / virtual host

CLI Example:

salt '*' rabbitmq.list_queues messages consumers
salt.modules.rabbitmq.list_queues_vhost(vhost, runas=None, *args)

Returns queue details of specified virtual host. This command will consider first parameter as the vhost name and rest will be treated as queueinfoitem. For getting details on vhost /, use list_queues instead).

CLI Example:

salt '*' rabbitmq.list_queues messages consumers
salt.modules.rabbitmq.list_user_permissions(name, runas=None)

List permissions for a user via rabbitmqctl list_user_permissions

CLI Example:

salt '*' rabbitmq.list_user_permissions 'user'.
salt.modules.rabbitmq.list_users(runas=None)

Return a list of users based off of rabbitmqctl user_list.

CLI Example:

salt '*' rabbitmq.list_users
salt.modules.rabbitmq.list_vhosts(runas=None)

Return a list of vhost based on rabbitmqctl list_vhosts.

CLI Example:

salt '*' rabbitmq.list_vhosts
salt.modules.rabbitmq.plugin_is_enabled(name, runas=None)

Return whether the plugin is enabled.

CLI Example:

salt '*' rabbitmq.plugin_is_enabled rabbitmq_plugin_name
salt.modules.rabbitmq.policy_exists(vhost, name, runas=None)

Return whether the policy exists based on rabbitmqctl list_policies.

Reference: http://www.rabbitmq.com/ha.html

CLI Example:

salt '*' rabbitmq.policy_exists / HA
salt.modules.rabbitmq.reset(runas=None)

Return a RabbitMQ node to its virgin state

CLI Example:

salt '*' rabbitmq.reset
salt.modules.rabbitmq.set_permissions(vhost, user, conf='.*', write='.*', read='.*', runas=None)

Sets permissions for vhost via rabbitmqctl set_permissions

CLI Example:

salt '*' rabbitmq.set_permissions 'myvhost' 'myuser'
salt.modules.rabbitmq.set_policy(vhost, name, pattern, definition, priority=None, apply_to=None, runas=None)

Set a policy based on rabbitmqctl set_policy.

Reference: http://www.rabbitmq.com/ha.html

CLI Example:

salt '*' rabbitmq.set_policy / HA '.*' '{"ha-mode":"all"}'
salt.modules.rabbitmq.set_user_tags(name, tags, runas=None)

Add user tags via rabbitmqctl set_user_tags

CLI Example:

salt '*' rabbitmq.set_user_tags 'myadmin' 'administrator'
salt.modules.rabbitmq.start_app(runas=None)

Start the RabbitMQ application.

CLI Example:

salt '*' rabbitmq.start_app
salt.modules.rabbitmq.status(runas=None)

return rabbitmq status

CLI Example:

salt '*' rabbitmq.status
salt.modules.rabbitmq.stop_app(runas=None)

Stops the RabbitMQ application, leaving the Erlang node running.

CLI Example:

salt '*' rabbitmq.stop_app
salt.modules.rabbitmq.user_exists(name, runas=None)

Return whether the user exists based on rabbitmqctl list_users.

CLI Example:

salt '*' rabbitmq.user_exists rabbit_user
salt.modules.rabbitmq.vhost_exists(name, runas=None)

Return whether the vhost exists based on rabbitmqctl list_vhosts.

CLI Example:

salt '*' rabbitmq.vhost_exists rabbit_host