-
Notifications
You must be signed in to change notification settings - Fork 424
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
Unable to set/override default_user/pass #245
Comments
and what have you tried? We are all engineers here, lets leave the guesswork out, please. |
@nlawson Please provide the options that you have passed and the exact errors or messages you received. |
ok, I'm setting the following attributes {
"rabbitmq": {
"default_pass": "xxx",
"default_user": "guest",
"enabled_users": [
{
"name": "guest",
"password": "xxx",
"rights": [
{
"conf": ".*",
"read": ".*",
"vhost": null,
"write": ".*"
}
]
}
],
"loopback_users": [],
"version": "3.5.1"
}
} And my run list looks like this {
"run_list": [
"recipe[rabbitmq]",
"recipe[rabbitmq::mgmt_console]",
"recipe[rabbitmq::user_management]"
]
} Oddly if i don't run |
Hi! If that's your Obviously that's for |
so the cookbook ignores the environment settings in default? |
did try the override_attributes suggestion @jjasghar and the same result |
Can you put your whole environment json override file here? I think that's the point we're at here now. |
just tried that, and yes the same result |
I'm sorry, but I just tested this and i know it works. If you can't give us the information, we can't help you. Please reopen this when you have file that we can look at that you are leveraging for this issue. |
@jjasghar i gave you the information, and clearly it's not working, so just closing the issue doesn't resolve the problem. |
however removing /var/lib/rabbitmq/mnesia and restarting rabbitmq does properly set the guest password, so I'm guessing there is an issue of order of events issue. |
DISTRIB_ID=Ubuntu |
=WARNING REPORT==== 7-Apr-2015::16:36:02 === =ERROR REPORT==== 7-Apr-2015::16:36:02 === |
I'm setting the attributes in the environment, using knife environment edit ... |
Yep, that's the crux; you need an I'm thinking you're gonna need something like: {
"override_attributes": {
"rabbitmq": {
"default_pass": "xxx",
"default_user": "guest",
"enabled_users": [
{
"name": "guest",
"password": "xxx",
"rights": [
{
"conf": ".*",
"read": ".*",
"vhost": null,
"write": ".*"
}
]
}
],
"loopback_users": [],
"version": "3.5.1"
}
}
} Can you test the above first? We might have found an issue with the instantiation of the default and additional users; but first test the above if that fixes it it's NOT the fix but it should resolve the issue. We are going to keep this open till we have a solid answer for this. |
I think I've isolated the behaviour:
So the only way you can get in and change the initial administrator user would be to lay down the config before the package is installed or else you're stuck with defaults. That said, it looks like the issue at hand has nothing to do with precedence levels or the fact the attributes are set at the environment level. @nlawson it looks like you're getting bitten twice here. Suggested course of action:
|
thanks for digging a bit on this, i have created a wrapper cookbook to uses your cookbook to delete the guest user than create the new admin user with desired password, seems to work alright, however it seems a bit hackish. |
it would be curious to set the RUNLEVEL=1 during the dpkg -i event, in many cases this will prevent background process from starting automatically. |
I believe the user_management recipe could be fixed to preserve existing tags or at the very least be more intelligent. If you've already got a wrapper, then I'd advise just using LWRPs themselves directly instead of dealing with the optional recipes which are themselves just opinionated wrappers. As for setting a RUNLEVEL that seems like a potentially problematic cross-platform solution but there are a few ways that I can think of to get the desired behaviour. |
Additionally, there could be more testing of the optional recipes themselves. |
i am using the LWRP's in the wrapper, made that part easy, thanks for responding on this, i will admit i could have provided more details on the initial complaint, however on a side note, i felt like i had to fight to get this looked at, didn't leave me with a great impression, i know we all could do better with these kinds of interactions.. |
Reproducing errors is hard, doubly so without detail. Several folks volunteered their time today to look over this via video chat - I was brought in as a fresh set of eyes and even then it took me a few hours to fully repro and see that there were multiple issues in play. Sorry that the initial experience wasn't delightful and thanks for reporting so we can make this better! |
I do gratefully appreciate all the hard work that goes in to cookbooks like this one, and i'm grateful for this. |
I've got PR #252 open to address this issue and also, as a side affect, simplifies things a bit by having only one service resource declaration. @nlawson this should fix part of the issue but I'll need to open an issue for point 3 from #245 (comment) The fix is 3 parts:
I've confirmed this fixes the issue for both Debian and RHEL platform families and also means we are removing a few unnecessary starts/restarts of the service. |
Did #252 definitly fix this issue? I'm still unable to change the default username/password as of v4.1.2. I think it's because the rabbitmq-env.conf template causes an immediate restart of the rabbitmq service before the rabbtimq.conf template is processed (which is where the default user/pass are specified):
Notice on the initial chef run for a node the
comes before the
|
BTW I was able to verify the above by changing the default_user/default_pass in the .kitchen.yml file and converging a node. After manually installing curl and enabling the management plugin, I was still able to access the dashboard:
|
Would changing the rabbitmq-env.conf and rabbitmq.conf's notifications in the default recipe to |
Regardless of what i tried, it seems i can't override guest/guest
The text was updated successfully, but these errors were encountered: