Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add the abitity to add a queue #401

Closed
ivanovteo opened this issue Nov 15, 2016 · 10 comments

Comments

Projects
None yet
5 participants
@ivanovteo
Copy link

commented Nov 15, 2016

Hi,

It would be nice for us to have an add queue functionality.
Example:

rabbitmq_queue "/somequeue" do
  action :add
end

Thank you!

@biamorton

This comment has been minimized.

Copy link

commented Nov 27, 2017

need this too

@michaelklishin

This comment has been minimized.

Copy link
Member

commented Nov 27, 2017

Consider using definitions import instead.

@biamorton

This comment has been minimized.

Copy link

commented Nov 28, 2017

@michaelklishin do you have an example? ive been going over the docs for the last couple days and cant figure out how to do that using chef and this recipe

@jhazelwo-charter

This comment has been minimized.

Copy link

commented Nov 28, 2017

@biamorton Michael's dismission does not answer the original request but instead recommends importing an entire config file which will enforce the desired states (like X queues created)

This is a quick copy/paste example from an old mrd project I worked on. It's probably close to correct, but YMMV. Let me know if I can help with it.

In /etc/rabbitmq/rabbitmq.config you'd have something like

    {rabbitmq_management, [
        {load_definitions, "/etc/rabbitmq/definitions.json"}
    ]}

...and then in /etc/rabbitmq/definitions.json

{
  "rabbit_version":"3.6.10",
  "users":[
    {"name":"consume","password_hash":"cS...ac","hashing_algorithm":"rabbit_password_hashing_sha256","tags":""},
    {"name":"publish","password_hash":"9He...ES7","hashing_algorithm":"rabbit_password_hashing_sha256","tags":""},
    {"name":"control","password_hash":"tDzQ...0m","hashing_algorithm":"rabbit_password_hashing_sha256","tags":"administrator"}
  ],
  "vhosts":[
    {"name":"/"}
  ],
  "permissions":[
    {"user":"consume","vhost":"/","configure":".*","write":".*","read":".*"},
    {"user":"publish","vhost":"/","configure":" ","write":".*","read":" "},
    {"user":"control","vhost":"/","configure":".*","write":".*","read":".*"}
  ],
  "parameters":[],
  "global_parameters":[
    {"name":"cluster_name","value":"rabbit@mrd"}
  ],
  "policies":[],
  "queues":[
    {"name":"log","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}
  ],
  "exchanges":[],
  "bindings":[]
}

...and rabbitmq will "do the needful" by importing that json file when it starts.

IIRC The current running config can be exported from either the web interface or the rabbitmq management python script.

@jhazelwo-charter

This comment has been minimized.

Copy link

commented Nov 28, 2017

Apologies to @ivanovteo who waited over a year just for OP to refuse the idea without discussion. This sucks and I'm sorry for your experience. I'm not responsible for this project in any way- I just know how it feels when this happens.

@jjasghar

This comment has been minimized.

Copy link
Collaborator

commented Nov 28, 2017

This cookbook has grown exponentially since I took over maintenance of it. It seems we need to add a clear scope to this cookbook and identify where we should be focusing on.

It's nice to have suggestions, but being we have no cadence of releases, nor dedicated resources, a suggestion is that. If there was a PR attached to this issue and it did this, I'd love to upstream it, but as with most opensource goes it's all volunteer work.

@michaelklishin

This comment has been minimized.

Copy link
Member

commented Nov 28, 2017

There is an example of definitions import in the docs. It's a matter of having a local JSON file with definitions and a config entry.

Instead of adding more and more resources that use HTTP API or CLI tools, it would be a lot easier to add support for definitions import.

@biamorton

This comment has been minimized.

Copy link

commented Nov 28, 2017

so we dont have definitions import on this recipe either? Another way ive been looking into is to add rabbitmqadmin so I can just run the commands to add the queues after rabbit has started on vagrant

@michaelklishin

This comment has been minimized.

Copy link
Member

commented Nov 28, 2017

We do we arbitrary configuration keys support, which is all that's needed (plus a local file resource e.g. in a wrapper cookbook) to use definition files.

@michaelklishin

This comment has been minimized.

Copy link
Member

commented Nov 28, 2017

Adding built-in definition file path to this cookbook should be a fairly small task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.