[Crowbar] Changing Crowbar Cookbook

John Dewey john at dewey.ws
Thu Jan 19 16:40:33 CST 2012


Opscode wants tickets (http://tickets.opscode.com/secure/Dashboard.jspa) vs pull requests.



On Thursday, January 19, 2012 at 2:36 PM, Kevin Bringard wrote:

> Shouldn't be... I'm updating a not_if to fix a syntax error in the
> rabbitmqctl list_user_permissions
> 
> Here's my debugging output:
> 
> [Thu, 19 Jan 2012 22:02:15 +0000] DEBUG: Processing execute[rabbitmqctl
> set_permissions -p /nova nova ".*" ".*" ".*"] on
> de8-9a-8f-a0-31-0c.ewr1.attcompute.com (http://de8-9a-8f-a0-31-0c.ewr1.attcompute.com)
> [Thu, 19 Jan 2012 22:02:15 +0000] INFO: Processing execute[rabbitmqctl
> set_permissions -p /nova nova ".*" ".*" ".*"] action run
> (/var/cache/chef/cookbooks/rabbitmq/providers/user.rb line 38)
> [Thu, 19 Jan 2012 22:02:15 +0000] DEBUG: sh(rabbitmqctl
> list_user_permissions | grep nova)
> [Thu, 19 Jan 2012 22:02:15 +0000] INFO: execute[rabbitmqctl
> set_permissions -p /nova nova ".*" ".*" ".*"] sh(rabbitmqctl
> set_permissions -p /nova nova ".*" ".*" ".*")
> Setting permissions for user "nova" in vhost "/nova" ...
> ...done.
> [Thu, 19 Jan 2012 22:02:15 +0000] INFO: execute[rabbitmqctl
> set_permissions -p /nova nova ".*" ".*" ".*"] ran successfully
> 
> The lines I'm changing are here, specifically the not_if...
> 
> 
> action :set_permissions do
> if new_resource.vhost
> execute "rabbitmqctl set_permissions -p #{new_resource.vhost}
> #{new_resource.user} #{new_resource.permissions}" do
> puts "User: #{new_resource.user}"
> not_if "rabbitmqctl list_user_permissions #{new_resource.user} |
> grep #{new_resource.user}"
> Chef::Log.info (http://Log.info) "Setting RabbitMQ user permissions for
> '#{new_resource.user}' on vhost #{new_resource.vhost}."
> new_resource.updated_by_last_action(true)
> end
> else
> execute "rabbitmqctl set_permissions #{new_resource.user}
> #{new_resource.permissions}" do
> not_if "rabbitmqctl list_user_permissions #{new_resource.user} |
> grep #{new_resource.user}"
> Chef::Log.info (http://Log.info) "Setting RabbitMQ user permissions for
> '#{new_resource.user}'."
> new_resource.updated_by_last_action(true)
> end
> end
> end
> 
> You can see that in my updated cookebook the line should be running
> "rabbitmqctl list_user_permissions #{new_resource.user} | grep
> #{new_resource.user}", but if you look at tbe debugging output, it's only
> running "rabbitmqctl list_user_permissions | grep #{new_resource.user}"
> (which is syntactically incorrect since version 2.5 of rabbit).
> 
> 
> Anyway, so yea, I don't get why the cookbook doesn't seem to be updating
> :-/
> 
> I've forked the original opscode recipes, once I verify it's working I'm
> going to submit a pull request to them so it'll get upstream... Should I
> submit one to you guys as well, or will that get pulled in?
> 
> On 1/19/12 3:22 PM, "Andi_Abes at Dell.com (mailto:Andi_Abes at Dell.com)" <Andi_Abes at Dell.com (mailto:Andi_Abes at Dell.com)> wrote:
> 
> > Duh... sorry.
> > 
> > So, rabbit should be installed on the nova controller and on compute
> > nodes if you have Nova HA networking on.
> > 
> > The steps you described should suffice (this time for real ;) ) to update
> > a recipes.
> > However, most of the recipes are written to be idempotent - is your code
> > by chance in a block that's conditionalzed in some way that would prevent
> > it from executing?
> > 
> > (as a side note, if you do the pull thingie, it's an easy way to see the
> > deltas and comment on them... so my previous answer is not totally not
> > relevant...;)
> > 
> > a.
> > 
> > 
> > 
> > -----Original Message-----
> > From: crowbar-bounces On Behalf Of Kevin Bringard
> > Sent: Thursday, January 19, 2012 5:20 PM
> > To: crowbar
> > Subject: Re: [Crowbar] Changing Crowbar Cookbook
> > 
> > Thanks Andi,
> > 
> > I get the pull procedure, I'm just trying to test my changes before I
> > setup a pull request. I updated the user.rb like I outlined below and
> > then knife cookbook upload -o . crowbar and run chef-client, but my
> > changes aren't showing up. Is there something else I need to do to get my
> > changes to take effect?
> > 
> > -- Kevin
> > 
> > On 1/19/12 3:15 PM, "Andi_Abes at Dell.com (mailto:Andi_Abes at Dell.com)" <Andi_Abes at Dell.com (mailto:Andi_Abes at Dell.com)> wrote:
> > 
> > > You would have to create a pull request on git hub.
> > > 
> > > To do that, create your own fork of the relevant repo, push your
> > > changes into that fork and then create a pull request.
> > > Here are some guides:
> > > * http://help.github.com/fork-a-repo/
> > > * http://help.github.com/send-pull-requests/
> > > 
> > > 
> > > I'll add a page on the wiki about how to contribute... should probably
> > > have had it.
> > > 
> > > a.
> > > 
> > > 
> > > 
> > > -----Original Message-----
> > > From: crowbar-bounces On Behalf Of Kevin Bringard
> > > Sent: Thursday, January 19, 2012 4:41 PM
> > > To: crowbar
> > > Subject: [Crowbar] Changing Crowbar Cookbook
> > > 
> > > Hey all,
> > > 
> > > I found a bug in one of the OpsCode recpies... I updated it and was
> > > trying to push it into place, but it doesn't seem to be updating. Here
> > > is what I am doing (this is all on the crowbar admin node):
> > > 
> > > Cd /opt/dell/barclamps/crowbar/chef/cookbooks
> > > Vi rabbitmq/providers/user.rb
> > > 
> > > <hack hack hack/>
> > > 
> > > knife cookbook upload -o . Crowbar
> > > 
> > > Then on the clients, I run chef-client and examine the output, but I
> > > don't see my changes (I put some puts in place for debugging).
> > > 
> > > Am I missing something? Is there another step I need to be taking?
> > > 
> > > Thanks!
> > > 
> > > -- Kevin
> > > 
> > > _______________________________________________
> > > Crowbar mailing list
> > > Crowbar at dell.com (mailto:Crowbar at dell.com)
> > > https://lists.us.dell.com/mailman/listinfo/crowbar
> > > For more information: https://github.com/dellcloudedge/crowbar/wiki
> > > 
> > 
> > 
> > _______________________________________________
> > Crowbar mailing list
> > Crowbar at dell.com (mailto:Crowbar at dell.com)
> > https://lists.us.dell.com/mailman/listinfo/crowbar
> > For more information: https://github.com/dellcloudedge/crowbar/wiki
> > 
> 
> 
> _______________________________________________
> Crowbar mailing list
> Crowbar at dell.com (mailto:Crowbar at dell.com)
> https://lists.us.dell.com/mailman/listinfo/crowbar
> For more information: https://github.com/dellcloudedge/crowbar/wiki
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.us.dell.com/pipermail/crowbar/attachments/20120119/9ed8c212/attachment.html 


More information about the Crowbar mailing list