voxpupuli / puppet-rabbitmq

RabbitMQ Puppet Module
http://forge.puppetlabs.com/puppet/rabbitmq
Apache License 2.0
172 stars 503 forks source link

forced to run twice due to failing provider detection #95

Closed zeph closed 11 years ago

zeph commented 11 years ago
err: /Stage[main]/Rabbitmq::Management/Rabbitmq_user[guest]: Provider rabbitmqctl is not functional on this host

u can checkout my https://github.com/zeph/mcollective-lnmp and type "vagrant up" to see it

u need to rekick puppet via "vagrant provision" to see it succeed

jurgenweber commented 11 years ago

run puppet a second time and it works fine, it is just the first time where it fails.

bodepd commented 11 years ago

@zeph

try reverting this patch and see if it works:

https://github.com/puppetlabs/puppetlabs-rabbitmq/commit/0c4ba9bff3f6c4306b9d4eedb6847ad0b9cc2c98

This patch looks like it would result in that behavior

apenney commented 11 years ago

Hmm, this is unexpected (and of course I can't reproduce it easily in testing). I can confirm what you're seeing via vagrant and it's definitely odd. We do a rabbitmqctl list_users -q and look for 'unable to connect to node'. If we get that we fail out the providers.

I can see that the service refreshed and is running prior to the first attempted load of the provider, so this should work. At least my understanding was that providers don't run the :confine block until they are actually called for the first time so it shouldn't have done it up front and cached that result past the start of the service.

I'm torn over the right thing to do here. We want the provider to fail if the service isn't up so users don't have to specify their own requires, but if this is going to fail on every first run then it won't do. I'll dig into this a little more and see if I can find out exactly what is happening.

jurgenweber commented 11 years ago

Yeah, I can confirm reverting that code resolved the issue as well.

Thanks

apenney commented 11 years ago

I'll give in and switch these over to just autorequires the service. I wanted to avoid that as I couldn't autorequires the service but it seems like a cleaner solution and should hopefully work for a first run.

Testing with your vagrant and the changes:

Notice: /Stage[main]/Roles::Middleware/Rabbitmq_user[mcollective]/ensure: created

I'll get a PR in to make these changes.

zeph commented 11 years ago

awesome! tnx @apenney & @bodepd :+1:

apenney commented 11 years ago

@zeph https://github.com/puppetlabs/puppetlabs-rabbitmq/pull/96 - give that a whirl, seems to work better for me. If you have success I'll merge it.

jurgenweber commented 11 years ago

Yeah, works great for me. Thanks.

apenney commented 11 years ago

Awesome, closing this for now then!